/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('sae', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AclConfig {
  aclEntries?: [
    AclEntryConfig
  ](name='aclEntries', description='This parameter is required.', nullable=true),
}

model AclEntryConfig {
  entry?: string(name='entry', description='This parameter is required.', example='1.2.3.4/32'),
}

model AppStackInstance {
  createTime?: long(name='CreateTime', example='1706518652'),
  endpoints?: [ 
    {
      address?: string(name='Address', example='127.0.0.1:8211'),
      name?: string(name='Name', example='game'),
      protocol?: string(name='Protocol', example='UDP'),
    }
  ](name='Endpoints'),
  instanceId?: string(name='InstanceId', example='i-789y'),
  instanceName?: string(name='InstanceName', example='palworld'),
  parameters?: [ 
    {
      name?: string(name='Name', example='regionId'),
      value?: string(name='Value', example='cn-hangzhou'),
    }
  ](name='Parameters'),
  stackId?: string(name='StackId', example='palworld'),
  status?: string(name='Status', example='WAIT'),
  updateTime?: long(name='UpdateTime', example='1706518652'),
}

model AppStackResource {
  createTime?: long(name='CreateTime', example='1706518652000'),
  instanceId?: string(name='InstanceId', example='i-78yt'),
  productCode?: string(name='ProductCode', example='VPC'),
  resourceId?: string(name='ResourceId', example='vsw-qwe112233'),
  resourceName?: string(name='ResourceName', example='vsw-palworld-a'),
  resourceType?: string(name='ResourceType', example='VSWITCH'),
  stackId?: string(name='StackId', example='palworld'),
  status?: string(name='Status', example='NORMAL'),
}

model AppStackTask {
  createTime?: long(name='CreateTime', example='1706518652'),
  endTime?: long(name='EndTime', example='1706518652'),
  instanceId?: string(name='InstanceId', example='i-789y'),
  stackId?: string(name='StackId', example='palworld'),
  startTime?: long(name='StartTime', example='1706518652'),
  status?: string(name='Status', example='WAIT'),
  steps?: [ 
    {
      code?: string(name='Code', example='OK'),
      duration?: long(name='Duration', example='0'),
      endTime?: long(name='EndTime', example='1706518652'),
      id?: string(name='Id', example='VPC_CREATE_NETWORK'),
      message?: string(name='Message', example='OK'),
      name?: string(name='Name', example='初始化 VPC 网络'),
      startTime?: long(name='StartTime', example='1706518652'),
      status?: string(name='Status', example='WAIT'),
    }
  ](name='Steps'),
  taskId?: string(name='TaskId', example='t-789y-deploy'),
}

model Application {
  requestId?: string(name='RequestId'),
  applicationId?: string(name='applicationId'),
  applicationName?: string(name='applicationName'),
  args?: string(name='args'),
  caPort?: int32(name='caPort'),
  codeChecksum?: string(name='codeChecksum'),
  codeSize?: long(name='codeSize'),
  command?: string(name='command'),
  cpu?: float(name='cpu'),
  createdTime?: string(name='createdTime'),
  customDNS?: CustomDNS(name='customDNS'),
  customDomainName?: string(name='customDomainName'),
  customHealthCheckConfig?: CustomHealthCheckConfig(name='customHealthCheckConfig'),
  customHostAlias?: CustomHostAlias(name='customHostAlias'),
  customRuntimeConfig?: CustomRuntimeConfig(name='customRuntimeConfig'),
  description?: string(name='description'),
  diskSize?: int32(name='diskSize'),
  enableAppMetric?: boolean(name='enableAppMetric'),
  enableArmsAdvanced?: boolean(name='enableArmsAdvanced'),
  environmentVariables?: map[string]string(name='environmentVariables'),
  gpuMemorySize?: int32(name='gpuMemorySize'),
  handler?: string(name='handler'),
  httpTriggerConfig?: HTTPTriggerConfig(name='httpTriggerConfig'),
  imageConfig?: ImageConfig(name='imageConfig'),
  initializationTimeout?: int32(name='initializationTimeout'),
  initializer?: string(name='initializer'),
  instanceConcurrency?: int32(name='instanceConcurrency'),
  instanceLifecycleConfig?: InstanceLifecycleConfig(name='instanceLifecycleConfig'),
  instanceSoftConcurrency?: int32(name='instanceSoftConcurrency'),
  instanceType?: string(name='instanceType'),
  internetAccess?: boolean(name='internetAccess'),
  lastModifiedTime?: string(name='lastModifiedTime'),
  layers?: [ string ](name='layers'),
  layersArnV2?: [ string ](name='layersArnV2'),
  livenessProbe?: Probe(name='livenessProbe'),
  logConfig?: LogConfig(name='logConfig'),
  memorySize?: int32(name='memorySize'),
  namespace?: string(name='namespace'),
  namespaceID?: string(name='namespaceID'),
  namespaceName?: string(name='namespaceName'),
  nasConfig?: NASConfig(name='nasConfig'),
  ossMountConfig?: OSSMountConfig(name='ossMountConfig'),
  programmingLanguage?: string(name='programmingLanguage'),
  runtime?: string(name='runtime'),
  scaleConfig?: ScaleConfig(name='scaleConfig'),
  slsConfig?: SLSConfig(name='slsConfig'),
  startupProbe?: Probe(name='startupProbe'),
  timeout?: int32(name='timeout'),
  tracingConfig?: TracingConfig(name='tracingConfig'),
  urlInternet?: string(name='urlInternet'),
  urlIntranet?: string(name='urlIntranet'),
  version?: Version(name='version'),
  vpcConfig?: VPCConfig(name='vpcConfig'),
}

model ApplicationStatus {
  instanceCount?: long(name='instanceCount'),
  scaleConfig?: ScaleConfig(name='scaleConfig'),
}

model ApplicationWithStatus {
  application?: Application(name='application'),
  status?: ApplicationStatus(name='status'),
}

model ArmsConfig {
  agentVersion?: string(name='agentVersion'),
  appId?: string(name='appId'),
  licenseKey?: string(name='licenseKey'),
}

model BuildPipeline {
  applicationId?: string(name='ApplicationId', description='This parameter is required.'),
  applicationName?: string(name='ApplicationName', description='This parameter is required.'),
  buildConfig?: {
    beforeBuildCommand?: string(name='BeforeBuildCommand', example='mvn clean package'),
    buildType?: string(name='BuildType', description='This parameter is required.', example='buildpacks/dockerfile'),
    dockerfilePath?: string(name='DockerfilePath', example='code/Dockerfile'),
    runCommand?: string(name='RunCommand', example='java -jar target/app.jar'),
    runtimeType?: string(name='RuntimeType'),
    runtimeVersion?: string(name='RuntimeVersion'),
    tomcatConfig?: TomcatConfig(name='TomcatConfig'),
    workingDir?: string(name='WorkingDir', example='code'),
  }(name='BuildConfig', description='This parameter is required.'),
  codeConfig?: {
    accountId?: string(name='AccountId', description='This parameter is required.', example='10000'),
    branchName?: string(name='BranchName', description='This parameter is required.', example='master'),
    commitId?: string(name='CommitId'),
    commitUrl?: string(name='CommitUrl'),
    organizationId?: string(name='OrganizationId'),
    provider?: string(name='Provider', description='This parameter is required.', example='github/gitee/gitlab等'),
    repoFullName?: string(name='RepoFullName', description='This parameter is required.', example='sae-samples/java-maven-demo'),
    repoId?: string(name='RepoId', description='This parameter is required.', example='3001'),
  }(name='CodeConfig', description='This parameter is required.'),
  deployConfig?: {
    alwaysAllocateCPU?: boolean(name='AlwaysAllocateCPU'),
    maximumInstanceCount?: int32(name='MaximumInstanceCount'),
    minimumInstanceCount?: int32(name='MinimumInstanceCount'),
    updateApplicationInput?: string(name='UpdateApplicationInput'),
    updateTraffic?: boolean(name='UpdateTraffic'),
  }(name='DeployConfig'),
  enabled?: boolean(name='Enabled'),
  imageConfig?: {
    instanceType?: string(name='InstanceType', example='ACR/ACREE'),
    namespace?: string(name='Namespace'),
    repository?: string(name='Repository'),
  }(name='ImageConfig'),
  packageConfig?: {
    packageName?: string(name='PackageName'),
    packageType?: string(name='PackageType', example='war/jar/zip'),
    packageUrl?: string(name='PackageUrl', example='http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar'),
    packageVersion?: string(name='PackageVersion', example='1.0.0'),
  }(name='PackageConfig'),
  triggerConfig?: {
    branchName?: string(name='BranchName', example='master'),
    tagName?: string(name='TagName', example='v1'),
    type?: string(name='Type', description='This parameter is required.', example='PUSH'),
  }(name='TriggerConfig', description='This parameter is required.'),
}

model BuildPipelineRun {
  buildConfig?: {
    beforeBuildCommand?: string(name='BeforeBuildCommand', example='mvn clean package'),
    buildType?: string(name='BuildType', description='This parameter is required.', example='buildpacks/dockerfile'),
    dockerfilePath?: string(name='DockerfilePath', example='code/Dockerfile'),
    runCommand?: string(name='RunCommand', example='java -jar target/app.jar'),
    runtimeType?: string(name='RuntimeType'),
    runtimeVersion?: string(name='RuntimeVersion'),
    tomcatConfig?: TomcatConfig(name='TomcatConfig'),
    trigger?: {
      branchName?: string(name='BranchName', example='master'),
      tagName?: string(name='TagName', example='v1'),
      type?: string(name='Type', description='This parameter is required.', example='PUSH'),
    }(name='Trigger', description='This parameter is required.'),
    workingDir?: string(name='WorkingDir', example='code'),
  }(name='BuildConfig'),
  buildDuration?: long(name='BuildDuration'),
  codeConfig?: {
    accountId?: string(name='AccountId', description='This parameter is required.', example='10000'),
    branchName?: string(name='BranchName', description='This parameter is required.', example='master'),
    commitId?: string(name='CommitId'),
    commitUrl?: string(name='CommitUrl'),
    organizationId?: string(name='OrganizationId'),
    provider?: string(name='Provider', description='This parameter is required.', example='github/gitee/gitlab等'),
    repoFullName?: string(name='RepoFullName', description='This parameter is required.', example='sae-samples/java-maven-demo'),
    repoId?: string(name='RepoId', description='This parameter is required.', example='3001'),
  }(name='CodeConfig'),
  createTime?: long(name='CreateTime'),
  deployConfig?: {
    alwaysAllocateCPU?: boolean(name='AlwaysAllocateCPU'),
    maximumInstanceCount?: int32(name='MaximumInstanceCount'),
    minimumInstanceCount?: int32(name='MinimumInstanceCount'),
    updateApplicationInput?: string(name='UpdateApplicationInput'),
    updateTraffic?: boolean(name='UpdateTraffic'),
  }(name='DeployConfig'),
  deployDuration?: long(name='DeployDuration'),
  endTime?: long(name='EndTime'),
  imageConfig?: {
    instanceType?: string(name='InstanceType'),
    namespace?: string(name='Namespace'),
    repository?: string(name='Repository'),
  }(name='ImageConfig'),
  packageConfig?: {
    packageName?: string(name='PackageName'),
    packageType?: string(name='PackageType'),
    packageUrl?: string(name='PackageUrl'),
    packageVersion?: string(name='PackageVersion'),
  }(name='PackageConfig'),
  pipelineId?: string(name='PipelineId'),
  pipelineRunId?: string(name='PipelineRunId'),
  startTime?: long(name='StartTime'),
  status?: string(name='Status'),
  steps?: [ 
    {
      description?: string(name='Description'),
      duration?: long(name='Duration'),
      endTime?: long(name='EndTime'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      result?: string(name='Result'),
      startTime?: long(name='StartTime'),
      status?: string(name='Status'),
    }
  ](name='Steps'),
  triggerConfig?: {
    branchName?: string(name='BranchName'),
    tagName?: string(name='TagName'),
    type?: string(name='Type'),
  }(name='TriggerConfig'),
  versionId?: string(name='VersionId'),
  waitDuration?: long(name='WaitDuration'),
}

model BuildPipelineRunLogLine {
  content?: string(name='Content'),
  offset?: long(name='Offset'),
}

model CertConfig {
  certName?: string(name='certName'),
  certificate?: string(name='certificate'),
  privateKey?: string(name='privateKey'),
}

model Container {
  args?: string(name='Args', example='["abc", ">", "file0"]'),
  command?: string(name='Command', example='["/bin/sh"]'),
  environmentVariables?: map[string]string(name='EnvironmentVariables'),
  image?: string(name='Image', description='This parameter is required.', example='registry.cn-shanghai.aliyuncs.com/serverless_devsxxxxx'),
  imageRegistryConfig?: ImageRegistryConfig(name='ImageRegistryConfig'),
  metricsCollectConfig?: MetricsCollectConfig(name='MetricsCollectConfig'),
  port?: int32(name='Port', example='8080'),
  requestConcurrency?: int32(name='RequestConcurrency', example='100'),
  requestTimeout?: int32(name='RequestTimeout', example='60'),
  resources?: ContainerResources(name='Resources', description='This parameter is required.'),
  SLSCollectConfigs?: SLSCollectConfigs(name='SLSCollectConfigs'),
  startupProbe?: StartupProbe(name='StartupProbe'),
  webNASConfig?: WebNASConfig(name='WebNASConfig'),
  webOSSConfig?: WebOSSConfig(name='WebOSSConfig'),
}

model ContainerResources {
  cpu?: int32(name='Cpu', description='This parameter is required.', example='2000'),
  memory?: int32(name='Memory', description='This parameter is required.', example='2048'),
}

model CreateApplicationInput {
  applicationName?: string(name='applicationName'),
  args?: string(name='args'),
  caPort?: int32(name='caPort'),
  code?: InputCodeLocation(name='code'),
  command?: string(name='command'),
  cpu?: float(name='cpu'),
  customDNS?: CustomDNS(name='customDNS'),
  customHealthCheckConfig?: CustomHealthCheckConfig(name='customHealthCheckConfig'),
  customHostAlias?: CustomHostAlias(name='customHostAlias'),
  customRuntimeConfig?: CustomRuntimeConfig(name='customRuntimeConfig'),
  description?: string(name='description'),
  diskSize?: int32(name='diskSize'),
  enableAppMetric?: boolean(name='enableAppMetric'),
  environmentVariables?: map[string]string(name='environmentVariables'),
  gpuMemorySize?: int32(name='gpuMemorySize'),
  handler?: string(name='handler'),
  httpTriggerConfig?: HTTPTriggerConfig(name='httpTriggerConfig'),
  imageConfig?: ImageConfig(name='imageConfig'),
  initializationTimeout?: int32(name='initializationTimeout'),
  initializer?: string(name='initializer'),
  instanceConcurrency?: int32(name='instanceConcurrency'),
  instanceLifecycleConfig?: InstanceLifecycleConfig(name='instanceLifecycleConfig'),
  instanceSoftConcurrency?: int32(name='instanceSoftConcurrency'),
  instanceType?: string(name='instanceType'),
  internetAccess?: boolean(name='internetAccess'),
  layers?: [ string ](name='layers'),
  livenessProbe?: Probe(name='livenessProbe'),
  logConfig?: LogConfig(name='logConfig'),
  memorySize?: int32(name='memorySize'),
  namespaceID?: string(name='namespaceID'),
  nasConfig?: NASConfig(name='nasConfig'),
  ossMountConfig?: OSSMountConfig(name='ossMountConfig'),
  programmingLanguage?: string(name='programmingLanguage'),
  runtime?: string(name='runtime'),
  scaleConfig?: ScaleConfig(name='scaleConfig'),
  slsConfig?: SLSConfig(name='slsConfig'),
  startupProbe?: Probe(name='startupProbe'),
  timeout?: int32(name='timeout'),
  tracingConfig?: TracingConfig(name='tracingConfig'),
  vpcConfig?: VPCConfig(name='vpcConfig'),
}

model CreateCustomDomainInput {
  applicationName?: string(name='applicationName'),
  certConfig?: CertConfig(name='certConfig'),
  domainName?: string(name='domainName'),
  keepFullPath?: boolean(name='keepFullPath'),
  namespaceID?: string(name='namespaceID'),
  protocol?: string(name='protocol'),
  tlsConfig?: TLSConfig(name='tlsConfig'),
  wafConfig?: WAFConfig(name='wafConfig'),
}

model CreateSlsIndexRequest {
  logstore?: string(name='logstore'),
  project?: string(name='project'),
}

model CreateSlsIndexResponse {
  requestId?: string(name='RequestId'),
  logStore?: string(name='logStore'),
  project?: string(name='project'),
}

model CreateSlsResourceResponse {
  logStore?: string(name='logStore'),
  project?: string(name='project'),
  requestId?: string(name='requestId'),
}

model CreateWebApplicationInput {
  applicationName?: string(name='ApplicationName', description='This parameter is required.', example='sae-app'),
  description?: string(name='Description', example='my sae app'),
  revisionConfig?: RevisionConfig(name='RevisionConfig', description='This parameter is required.'),
  webNetworkConfig?: WebNetworkConfig(name='WebNetworkConfig'),
  webScalingConfig?: WebScalingConfig(name='WebScalingConfig'),
  webTrafficConfig?: WebTrafficConfig(name='WebTrafficConfig'),
}

model CreateWebCustomDomainInput {
  defaultForwardingAppName?: string(name='DefaultForwardingAppName'),
  domainName?: string(name='DomainName', description='This parameter is required.', example='example.com'),
  protocol?: string(name='Protocol', example='HTTP'),
  routeConfig?: RouteConfig(name='RouteConfig'),
  webCertConfig?: WebCertConfig(name='WebCertConfig'),
  webTLSConfig?: WebTLSConfig(name='WebTLSConfig'),
  webWAFConfig?: WebWAFConfig(name='WebWAFConfig'),
}

model CustomDNS {
  dnsOptions?: [
    DNSOption
  ](name='dnsOptions'),
  nameServers?: [ string ](name='nameServers'),
  searches?: [ string ](name='searches'),
}

model CustomDomain {
  accountId?: string(name='accountId'),
  apiVersion?: string(name='apiVersion'),
  certConfig?: CertConfig(name='certConfig'),
  createdTime?: string(name='createdTime'),
  domainName?: string(name='domainName'),
  keepFullPath?: boolean(name='keepFullPath'),
  lastModifiedTime?: string(name='lastModifiedTime'),
  namespaceID?: string(name='namespaceID'),
  protocol?: string(name='protocol'),
  requestId?: string(name='requestId'),
  routeConfig?: RouteConfig(name='routeConfig'),
  subdomainCount?: string(name='subdomainCount'),
  tlsConfig?: TLSConfig(name='tlsConfig'),
  wafConfig?: WAFConfig(name='wafConfig'),
}

model CustomHealthCheckConfig {
  failureThreshold?: int32(name='failureThreshold'),
  httpGetUrl?: string(name='httpGetUrl'),
  initialDelaySeconds?: int32(name='initialDelaySeconds'),
  periodSeconds?: int32(name='periodSeconds'),
  successThreshold?: int32(name='successThreshold'),
  timeoutSeconds?: int32(name='timeoutSeconds'),
}

model CustomHostAlias {
  hostAliases?: [
    HostAlias
  ](name='hostAliases'),
}

model CustomRuntimeConfig {
  args?: [ string ](name='args'),
  command?: [ string ](name='command'),
}

model DNSOption {
  name?: string(name='name'),
  value?: string(name='value'),
}

model DescribeInstanceLogsOutput {
  webLogEntrys?: [
    WebLogEntry
  ](name='WebLogEntrys'),
}

model DescribeWebAppStaticsOutput {
  length?: int32(name='Length'),
  webAppStatics?: [
    WebStaticsInfo
  ](name='WebAppStatics'),
}

model DescribeWebStaticsQueryOutput {
  length?: int32(name='Length'),
  webStatics?: [
    WebStaticsInfo
  ](name='WebStatics'),
}

model ExecAction {
  command?: [ string ](name='command'),
}

model ExternalErrorSAEWeb {
  code?: int32(name='code'),
  errorCode?: string(name='errorCode'),
  message?: string(name='message'),
  requestId?: string(name='requestId'),
  success?: boolean(name='success'),
}

model GRPCAction {
  port?: int32(name='port'),
  service?: string(name='service'),
}

model GetApplicationLogsInput {
  backwardLine?: long(name='backwardLine'),
  endTime?: long(name='endTime', description='This parameter is required.'),
  forwardLine?: long(name='forwardLine'),
  instanceID?: string(name='instanceID'),
  isTail?: boolean(name='isTail'),
  match?: string(name='match'),
  message?: string(name='message'),
  offset?: long(name='offset'),
  packID?: string(name='packID'),
  packMeta?: string(name='packMeta'),
  startTime?: long(name='startTime', description='This parameter is required.'),
  timestamp?: string(name='timestamp'),
  versionID?: string(name='versionID'),
}

model GetApplicationLogsOutput {
  logEntrys?: [
    LogEntry
  ](name='logEntrys'),
  nextOffset?: long(name='nextOffset'),
  requestId?: string(name='requestId'),
}

model GetInstanceLogsInput {
  backwardLine?: long(name='backwardLine'),
  endTime?: long(name='endTime', description='This parameter is required.'),
  forwardLine?: long(name='forwardLine'),
  isTail?: boolean(name='isTail'),
  match?: string(name='match'),
  message?: string(name='message'),
  offset?: long(name='offset'),
  packID?: string(name='packID'),
  packMeta?: string(name='packMeta'),
  startTime?: long(name='startTime', description='This parameter is required.'),
  timestamp?: string(name='timestamp'),
  versionID?: string(name='versionID'),
}

model GetInstanceLogsOutput {
  data?: string(name='data'),
  requestId?: string(name='requestId'),
}

model GetPerRequestLogsInput {
  endTime?: long(name='endTime', description='This parameter is required.'),
  errorType?: string(name='errorType'),
  forwardLine?: long(name='forwardLine'),
  instanceID?: string(name='instanceID'),
  isColdStart?: boolean(name='isColdStart'),
  requestID?: string(name='requestID', description='This parameter is required.'),
  startTime?: long(name='startTime', description='This parameter is required.'),
  timestamp?: string(name='timestamp'),
}

model GetPerRequestLogsOutput {
  data?: string(name='data'),
  requestId?: string(name='requestId'),
}

model GetQuotaOutput {
  requestId?: string(name='RequestId'),
  instanceLimit?: long(name='instanceLimit'),
  instanceUsed?: long(name='instanceUsed'),
}

model HTTPGetAction {
  host?: string(name='Host'),
  httpHeaders?: [
    HTTPHeader
  ](name='HttpHeaders'),
  path?: string(name='Path'),
  port?: int32(name='Port'),
  scheme?: string(name='Scheme'),
}

model HTTPHeader {
  name?: string(name='name'),
  value?: string(name='value'),
}

model HTTPTriggerConfig {
  aclConfig?: AclConfig(name='aclConfig'),
  authConfig?: any(name='authConfig'),
  authType?: string(name='authType'),
  disableURLInternet?: boolean(name='disableURLInternet'),
  safeMode?: boolean(name='safeMode'),
}

model HostAlias {
  hostnames?: [ string ](name='hostnames'),
  ip?: string(name='ip'),
}

model HttpApiRoute {
  addressType?: string(name='AddressType', example='intranet/internet'),
  deployStatus?: string(name='DeployStatus', example='Deploying/NotDeployed/Undeploying/Deployed'),
  destinationType?: string(name='DestinationType', example='Single/Multiple/VersionOriented'),
  domains?: [ 
    {
      domainId?: string(name='DomainId'),
      domainName?: string(name='DomainName'),
    }
  ](name='Domains'),
  environmentId?: string(name='EnvironmentId'),
  gatewayId?: string(name='GatewayId'),
  httpApiId?: string(name='HttpApiId'),
  httpApiName?: string(name='HttpApiName', example='Http'),
  httpApiType?: string(name='HttpApiType', example='Http'),
  ingressId?: long(name='IngressId', example='1'),
  nacosInstanceId?: string(name='NacosInstanceId'),
  nacosNamespaceId?: string(name='NacosNamespaceId', example='test'),
  name?: string(name='Name'),
  namespaceId?: string(name='NamespaceId'),
  policies?: {
    fallback?: {
      destinations?: [ 
        {
          appId?: string(name='AppId'),
          appName?: string(name='AppName'),
          serviceId?: string(name='ServiceId'),
          serviceName?: string(name='ServiceName'),
          servicePort?: long(name='ServicePort'),
          serviceProtocol?: string(name='ServiceProtocol'),
        }
      ](name='Destinations'),
      enable?: boolean(name='Enable'),
    }(name='Fallback'),
    retry?: {
      attempts?: long(name='Attempts'),
      enable?: boolean(name='Enable', example='true/false'),
      httpCodes?: [ string ](name='HttpCodes'),
      retryOn?: [ string ](name='RetryOn'),
    }(name='Retry'),
    timeout?: {
      enable?: boolean(name='Enable'),
      timeUnit?: string(name='TimeUnit', example='s'),
      unitNum?: long(name='UnitNum'),
    }(name='Timeout'),
  }(name='Policies'),
  predicates?: {
    headerPredicates?: [ 
      {
        name?: string(name='Name'),
        type?: string(name='Type', example='Prefix/Exact/Regex'),
        value?: string(name='Value'),
      }
    ](name='HeaderPredicates'),
    methodPredicates?: [ string ](name='MethodPredicates'),
    pathPredicates?: {
      ignoreCase?: boolean(name='IgnoreCase'),
      path?: string(name='Path'),
      type?: string(name='Type', example='Prefix/Exact/Regex'),
    }(name='PathPredicates'),
    queryPredicates?: [ 
      {
        name?: string(name='Name'),
        type?: string(name='Type', example='Prefix/Exact/Regex'),
        value?: string(name='Value'),
      }
    ](name='QueryPredicates'),
  }(name='Predicates'),
  routeId?: string(name='RouteId'),
  services?: [ 
    {
      appId?: string(name='AppId'),
      appName?: string(name='AppName'),
      serviceId?: string(name='ServiceId'),
      serviceName?: string(name='ServiceName'),
      servicePort?: long(name='ServicePort'),
      serviceProtocol?: string(name='ServiceProtocol', example='HTTP'),
      serviceWeight?: long(name='ServiceWeight', example='90'),
    }
  ](name='Services'),
  sourceType?: string(name='SourceType', example='SAE_NACOS/SAE_K8S_SERVICE/MSE_NACOS'),
}

model ImageConfig {
  accelerationType?: string(name='accelerationType'),
  image?: string(name='image'),
  instanceID?: string(name='instanceID'),
  registryConfig?: RegistryConfig(name='registryConfig'),
}

model ImageRegistryConfig {
  authConfig?: RegistryAuthenticationConfig(name='AuthConfig'),
  certConfig?: RegistryCertificateConfig(name='CertConfig'),
}

model InitContainerConfig {
  command?: string(name='Command'),
  commandArgs?: string(name='CommandArgs'),
  configMapMountDesc?: string(name='ConfigMapMountDesc'),
  envs?: string(name='Envs'),
  imageUrl?: string(name='ImageUrl'),
  name?: string(name='Name'),
}

model InputCodeLocation {
  ossBucketName?: string(name='ossBucketName'),
  ossObjectName?: string(name='ossObjectName'),
  zipFile?: string(name='zipFile'),
}

model InstanceExecAuthorizationInput {
  options?: InstanceExecAuthorizationInputOptions(name='options'),
}

model InstanceExecAuthorizationInputOptions {
  command?: [ string ](name='command'),
  stderr?: boolean(name='stderr'),
  stdin?: boolean(name='stdin'),
  stdout?: boolean(name='stdout'),
  tty?: boolean(name='tty'),
}

model InstanceExecAuthorizationOutput {
  accessKeyId?: string(name='accessKeyId'),
  accountId?: string(name='accountId'),
  authorization?: string(name='authorization'),
  date?: string(name='date'),
  endpoint?: string(name='endpoint'),
  requestId?: string(name='requestId'),
}

model InstanceInfo {
  imageUrl?: string(name='imageUrl'),
  instanceId?: string(name='instanceId'),
  status?: string(name='status'),
  versionId?: string(name='versionId'),
}

model InstanceLifecycleConfig {
  preFreeze?: LifecycleHook(name='preFreeze'),
  preStop?: LifecycleHook(name='preStop'),
}

model InstanceMetricInfo {
  applicationID?: string(name='applicationID', example='a03aa9f9-3d32-4655-8394-05fd10dcbd8a'),
  cpuPercent?: float(name='cpuPercent', example='1.98'),
  cpuQuotaPercent?: float(name='cpuQuotaPercent', example='35.0'),
  instanceID?: string(name='instanceID', example='c-6498f0fe-33bb4f9249b54789a023'),
  memoryLimitMB?: float(name='memoryLimitMB', example='512.0'),
  memoryUsageMB?: float(name='memoryUsageMB', example='8.81'),
  timestamp?: long(name='timestamp', example='1686568800000'),
}

model JaegerConfig {
  endpoint?: string(name='endpoint'),
}

model LifecycleHook {
  handler?: string(name='handler'),
  timeout?: int32(name='timeout'),
}

model ListApplicationVersionsOutput {
  direction?: string(name='direction'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId'),
  versions?: [
    Version
  ](name='versions'),
}

model ListApplicationsOutput {
  applications?: [
    Application
  ](name='applications'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId'),
}

model ListApplicationsWithStatusOutput {
  applications?: [
    ApplicationWithStatus
  ](name='applications'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId'),
}

model ListCustomDomainOutput {
  customDomains?: [
    CustomDomain
  ](name='customDomains'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId'),
}

model ListInstancesMetricsOutput {
  requestId?: string(name='RequestId'),
  metricsList?: [
    InstanceMetricInfo
  ](name='metricsList'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='100'),
  totalCount?: int32(name='totalCount', example='1234'),
}

model ListInstancesOutput {
  currentError?: string(name='currentError'),
  instances?: [
    InstanceInfo
  ](name='instances'),
  requestId?: string(name='requestId'),
  versionStatus?: map[string]VersionStatus(name='versionStatus'),
}

model ListMetricsOutput {
  requestId?: string(name='RequestId'),
  metrics?: map[string][
    MetricInfo
  ](name='metrics'),
}

model ListStaticsQueryResponse {
  length?: long(name='length'),
  sort?: string(name='sort'),
  statics?: [
    StaticsInfo
  ](name='statics'),
}

model ListWebApplicationInstancesBody {
  code?: int32(name='Code'),
  data?: ListWebInstancesOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListWebApplicationRevisionsBody {
  code?: int32(name='Code'),
  data?: ListWebApplicationRevisionsOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListWebApplicationRevisionsOutput {
  nextToken?: string(name='NextToken'),
  revisions?: [
    Revision
  ](name='Revisions'),
}

model ListWebApplicationsBody {
  code?: int32(name='Code'),
  data?: ListWebApplicationsOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListWebApplicationsOutput {
  nextToken?: string(name='NextToken'),
  webApplicationWithInstanceCount?: [
    WebApplicationWithInstanceCount
  ](name='WebApplicationWithInstanceCount'),
}

model ListWebCustomDomainBody {
  code?: int32(name='Code'),
  data?: ListWebCustomDomainOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListWebCustomDomainOutput {
  nextToken?: string(name='NextToken'),
  webCustomDomains?: [
    WebCustomDomain
  ](name='WebCustomDomains'),
}

model ListWebInstancesOutput {
  currentError?: string(name='CurrentError'),
  webInstances?: [
    WebInstanceInfo
  ](name='WebInstances'),
  webVersionStatus?: map[string]WebVersionStatus(name='WebVersionStatus'),
}

model LogConfig {
  enableInstanceMetrics?: boolean(name='enableInstanceMetrics'),
  enableRequestMetrics?: boolean(name='enableRequestMetrics'),
  logBeginRule?: string(name='logBeginRule'),
  logstore?: string(name='logstore'),
  project?: string(name='project'),
  pushToUserSLS?: boolean(name='pushToUserSLS'),
}

model LogEntry {
  instanceID?: string(name='instanceID'),
  message?: string(name='message'),
  offset?: long(name='offset'),
  packID?: string(name='packID'),
  packMeta?: string(name='packMeta'),
  qualifier?: string(name='qualifier'),
  timestamp?: int32(name='timestamp'),
  versionID?: string(name='versionID'),
}

model MetricInfo {
  average?: float(name='Average', example='1234.5'),
  count?: float(name='Count', example='1234.5'),
  maximum?: float(name='Maximum', example='1234.5'),
  minimum?: float(name='Minimum', example='1234.5'),
  sum?: float(name='Sum', example='1234.5'),
  timestamp?: long(name='timestamp', example='1686568800000'),
  value?: float(name='value', example='1234.5'),
}

model MetricsCollectConfig {
  enablePushToUserSLS?: boolean(name='EnablePushToUserSLS'),
  logstoreName?: string(name='LogstoreName', example='my-sls-logstorename'),
  projectName?: string(name='ProjectName', example='my-sls-project'),
}

model NASConfig {
  mountPoints?: [
    NASMountConfig
  ](name='mountPoints'),
}

model NASMountConfig {
  enableTLS?: boolean(name='enableTLS'),
  mountDir?: string(name='mountDir'),
  serverAddr?: string(name='serverAddr'),
}

model OSSMountConfig {
  mountPoints?: [
    OSSMountPoint
  ](name='mountPoints'),
}

model OSSMountPoint {
  bucketName?: string(name='bucketName'),
  bucketPath?: string(name='bucketPath'),
  mountDir?: string(name='mountDir'),
  readOnly?: boolean(name='readOnly'),
}

model PathConfig {
  applicationName?: string(name='applicationName'),
  path?: string(name='path'),
}

model PermissionAssistantApi {
  createTime?: string(name='createTime'),
  id?: long(name='id'),
  name?: string(name='name'),
  resourceType?: string(name='resourceType'),
  updateTime?: string(name='updateTime'),
}

model PolicyItem {
  key?: string(name='key'),
  operator?: string(name='operator'),
  type?: string(name='type'),
  value?: string(name='value'),
}

model PriceEstimateFeature {
  appType?: string(name='AppType', description='This parameter is required.', example='Web/MicroService'),
  cpuCore?: float(name='CpuCore', description='This parameter is required.', example='1'),
  cpuStrategy?: string(name='CpuStrategy', description='This parameter is required.', example='Request/Always'),
  envType?: string(name='EnvType', description='This parameter is required.', example='Test/Production'),
  highLoadInstanceCount?: long(name='HighLoadInstanceCount', example='3'),
  highLoadQps?: float(name='HighLoadQps', example='5'),
  highLoadSeconds?: long(name='HighLoadSeconds', example='3600'),
  instanceQps?: float(name='InstanceQps', example='2'),
  internetOutboundGiB?: float(name='InternetOutboundGiB', example='24'),
  lowLoadInstanceCount?: long(name='LowLoadInstanceCount', example='1'),
  lowLoadQps?: float(name='LowLoadQps', example='2'),
  lowLoadSeconds?: long(name='LowLoadSeconds', example='3600'),
  maxInstanceCount?: long(name='MaxInstanceCount', example='10'),
  memoryGiB?: float(name='MemoryGiB', description='This parameter is required.', example='1'),
  minInstanceCount?: long(name='MinInstanceCount', example='1'),
  noneLoadInstanceCount?: long(name='NoneLoadInstanceCount', example='0'),
  noneLoadSeconds?: long(name='NoneLoadSeconds', example='79200'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model PriceEstimateOutput {
  apps?: [ 
    {
      feature?: PriceEstimateFeature(name='Feature'),
      id?: long(name='Id', example='1'),
      usages?: [ 
        {
          amount?: float(name='Amount', example='3600.00'),
          id?: string(name='Id', example='Microservice_cpuUsage'),
          unit?: string(name='Unit', example='核*秒'),
        }
      ](name='Usages'),
    }
  ](name='Apps'),
  items?: [ 
    {
      amount?: float(name='Amount', example='3600.00'),
      count?: long(name='Count', example='1'),
      id?: string(name='Id', example='p_micro_service_cpu'),
      price?: float(name='Price', example='1.00'),
      steps?: [ 
        {
          begin?: long(name='Begin', example='0'),
          end?: long(name='End', example='10000'),
          price?: float(name='Price', example='0.0001'),
          regionIds?: [ string ](name='RegionIds'),
          unit?: string(name='Unit', example='核*秒'),
        }
      ](name='Steps'),
      type?: string(name='Type', example='pack/post'),
      unit?: string(name='Unit', example='核*秒'),
    }
  ](name='Items'),
  postPayItems?: [ 
    {
      amount?: float(name='Amount', example='3600.00'),
      count?: long(name='Count', example='1'),
      id?: string(name='Id', example='p_micro_service_cpu'),
      price?: float(name='Price', example='1.00'),
      steps?: [ 
        {
          begin?: long(name='Begin', example='0'),
          end?: long(name='End', example='10000'),
          price?: float(name='Price', example='0.0001'),
          regionIds?: [ string ](name='RegionIds'),
          unit?: string(name='Unit', example='核*秒'),
        }
      ](name='Steps'),
      type?: string(name='Type', example='pack/post'),
      unit?: string(name='Unit', example='核*秒'),
    }
  ](name='PostPayItems'),
  postPayTotalPrice?: float(name='PostPayTotalPrice', example='235.66'),
  totalPrice?: float(name='TotalPrice', example='235.66'),
}

model Probe {
  failureThreshold?: int32(name='failureThreshold'),
  initialDelaySeconds?: int32(name='initialDelaySeconds'),
  periodSeconds?: int32(name='periodSeconds'),
  probeHandler?: {
    httpGet?: {
      httpHeaders?: [ 
        {
          name?: string(name='name'),
          value?: string(name='value'),
        }
      ](name='httpHeaders'),
      path?: string(name='path'),
      port?: int32(name='port'),
    }(name='httpGet'),
    tcpSocket?: {
      port?: int32(name='port'),
    }(name='tcpSocket'),
  }(name='probeHandler'),
  timeoutSeconds?: int32(name='timeoutSeconds'),
}

model ProbeHandler {
  httpGet?: HTTPGetAction(name='HttpGet'),
  tcpSocket?: TCPSocketAction(name='TcpSocket'),
}

model PublishApplicationVersionInput {
  description?: string(name='description'),
}

model PublishWebApplicationRevisionInput {
  containers?: [
    Container
  ](name='Containers', description='This parameter is required.'),
  description?: string(name='Description', example='test version'),
  enableArmsMetrics?: boolean(name='EnableArmsMetrics'),
  takeEffect?: boolean(name='TakeEffect'),
}

model RegistryAuthConfig {
  password?: string(name='password', example='abc***'),
  role?: string(name='role', example='acs:ram::142xxxx:role/xxxxxx'),
  userName?: string(name='userName', example='admin'),
}

model RegistryAuthenticationConfig {
  password?: string(name='Password', example='abc***'),
  userName?: string(name='UserName', example='admin'),
}

model RegistryCertConfig {
  insecure?: boolean(name='insecure'),
  rootCaCertBase64?: string(name='rootCaCertBase64'),
}

model RegistryCertificateConfig {
  certBase64?: string(name='CertBase64', example='LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCmZha2VDZXJ0aWZpY2F0ZQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t'),
  insecure?: boolean(name='Insecure', example='true'),
}

model RegistryConfig {
  authConfig?: RegistryAuthConfig(name='authConfig'),
  certConfig?: RegistryCertConfig(name='certConfig'),
}

model Revision {
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  revisionConfig?: RevisionConfig(name='RevisionConfig'),
  revisionId?: string(name='RevisionId'),
  weight?: float(name='Weight'),
}

model RevisionConfig {
  containers?: [
    Container
  ](name='Containers', description='This parameter is required.'),
  enableArmsMetrics?: boolean(name='EnableArmsMetrics'),
  webNetworkConfig?: WebNetworkConfig(name='WebNetworkConfig'),
}

model RouteConfig {
  routes?: [
    PathConfig
  ](name='routes'),
}

model RoutePolicy {
  condition?: string(name='condition'),
  policyItems?: [
    PolicyItem
  ](name='policyItems'),
}

model SLSCollectConfig {
  logPath?: string(name='LogPath'),
  logType?: string(name='LogType'),
  logstoreName?: string(name='LogstoreName'),
  logtailName?: string(name='LogtailName'),
  machineGroup?: string(name='MachineGroup'),
  projectName?: string(name='ProjectName'),
}

model SLSCollectConfigs {
  collectConfigs?: [
    SLSCollectConfig
  ](name='CollectConfigs'),
}

model SLSConfig {
  collectConfigs?: [ 
    {
      logPath?: string(name='logPath'),
      logType?: string(name='logType'),
      logstoreName?: string(name='logstoreName'),
      logtailName?: string(name='logtailName'),
      projectName?: string(name='projectName'),
    }
  ](name='collectConfigs'),
}

model ScaleConfig {
  alwaysAllocateCPU?: boolean(name='alwaysAllocateCPU'),
  maximumInstanceCount?: long(name='maximumInstanceCount'),
  minimumInstanceCount?: long(name='minimumInstanceCount'),
  requestId?: string(name='requestId'),
}

model SidecarContainerConfig {
  acrInstanceId?: string(name='AcrInstanceId'),
  command?: string(name='Command'),
  commandArgs?: string(name='CommandArgs'),
  configMapMountDesc?: string(name='ConfigMapMountDesc'),
  cpu?: int32(name='Cpu'),
  emptyDirDesc?: string(name='EmptyDirDesc'),
  envs?: string(name='Envs'),
  imageUrl?: string(name='ImageUrl'),
  memory?: int32(name='Memory'),
  name?: string(name='Name'),
}

model SourceCodeAccount {
  avatarUrl?: string(name='AvatarUrl'),
  id?: string(name='Id'),
  name?: string(name='Name'),
  organizations?: [ 
    {
      avatarUrl?: string(name='AvatarUrl'),
      id?: string(name='Id'),
      name?: string(name='Name'),
    }
  ](name='Organizations'),
}

model SourceCodeRepo {
  fullName?: string(name='FullName'),
  id?: string(name='Id'),
  name?: string(name='Name'),
}

model SourceCodeRepoBranch {
  commitId?: string(name='CommitId'),
  name?: string(name='Name'),
}

model StartupProbe {
  failureThreshold?: int32(name='FailureThreshold'),
  initialDelaySeconds?: int32(name='InitialDelaySeconds'),
  periodSeconds?: int32(name='PeriodSeconds'),
  probeHandler?: ProbeHandler(name='ProbeHandler'),
  timeoutSeconds?: int32(name='TimeoutSeconds'),
}

model StaticsInfo {
  activeCPUUsage?: long(name='activeCPUUsage'),
  cost?: float(name='cost'),
  diskUsage?: long(name='diskUsage'),
  functionName?: string(name='functionName'),
  gpuUsage?: long(name='gpuUsage'),
  idleCPUUsage?: long(name='idleCPUUsage'),
  instanceTrafficOut?: long(name='instanceTrafficOut'),
  invocations?: long(name='invocations'),
  invokeCDNOut?: long(name='invokeCDNOut'),
  invokeInternetOut?: long(name='invokeInternetOut'),
  memoryUsage?: long(name='memoryUsage'),
  region?: string(name='region'),
  serviceName?: string(name='serviceName'),
}

model Submenu {
  items?: [ 
    {
      defaultSelected?: boolean(name='DefaultSelected'),
      itemDesc?: string(name='ItemDesc'),
      itemType?: string(name='ItemType'),
      relatingItems?: [ string ](name='RelatingItems'),
    }
  ](name='Items'),
  submenuDesc?: string(name='SubmenuDesc'),
  submenuType?: string(name='SubmenuType'),
  submenus?: [
    Submenu
  ](name='Submenus'),
}

model TCPSocketAction {
  host?: string(name='Host'),
  port?: int32(name='Port'),
}

model TLSConfig {
  cipherSuites?: [ string ](name='cipherSuites'),
  maxVersion?: string(name='maxVersion'),
  minVersion?: string(name='minVersion'),
}

model TomcatConfig {
  contextPath?: string(name='ContextPath'),
  maxThreads?: int32(name='MaxThreads'),
  port?: int32(name='Port'),
  uriEncoding?: string(name='UriEncoding'),
  useBodyEncodingForUri?: boolean(name='UseBodyEncodingForUri'),
  version?: string(name='Version'),
}

model TracingConfig {
  jaegerConfig?: JaegerConfig(name='jaegerConfig'),
  params?: any(name='params'),
  type?: string(name='type'),
}

model TrafficConfig {
  additionalVersionWeight?: map[string]float(name='additionalVersionWeight'),
  createdTime?: string(name='createdTime'),
  lastModifiedTime?: string(name='lastModifiedTime'),
  requestId?: string(name='requestId'),
  resolvePolicy?: string(name='resolvePolicy'),
  routePolicy?: RoutePolicy(name='routePolicy'),
  versionId?: string(name='versionId'),
}

model UpdateApplicationInput {
  args?: string(name='args'),
  caPort?: int32(name='caPort'),
  code?: InputCodeLocation(name='code'),
  command?: string(name='command'),
  cpu?: float(name='cpu'),
  customDNS?: CustomDNS(name='customDNS'),
  customHealthCheckConfig?: CustomHealthCheckConfig(name='customHealthCheckConfig'),
  customHostAlias?: CustomHostAlias(name='customHostAlias'),
  customRuntimeConfig?: CustomRuntimeConfig(name='customRuntimeConfig'),
  description?: string(name='description'),
  diskSize?: int32(name='diskSize'),
  effectiveImmediately?: boolean(name='effectiveImmediately'),
  enableAppMetric?: boolean(name='enableAppMetric'),
  environmentVariables?: map[string]string(name='environmentVariables'),
  gpuMemorySize?: int32(name='gpuMemorySize'),
  handler?: string(name='handler'),
  httpTriggerConfig?: HTTPTriggerConfig(name='httpTriggerConfig'),
  imageConfig?: ImageConfig(name='imageConfig'),
  initializationTimeout?: int32(name='initializationTimeout'),
  initializer?: string(name='initializer'),
  instanceConcurrency?: int32(name='instanceConcurrency'),
  instanceLifecycleConfig?: InstanceLifecycleConfig(name='instanceLifecycleConfig'),
  instanceSoftConcurrency?: int32(name='instanceSoftConcurrency'),
  instanceType?: string(name='instanceType'),
  internetAccess?: boolean(name='internetAccess'),
  layers?: [ string ](name='layers'),
  livenessProbe?: Probe(name='livenessProbe'),
  logConfig?: LogConfig(name='logConfig'),
  memorySize?: int32(name='memorySize'),
  namespaceID?: string(name='namespaceID'),
  nasConfig?: NASConfig(name='nasConfig'),
  ossMountConfig?: OSSMountConfig(name='ossMountConfig'),
  programmingLanguage?: string(name='programmingLanguage'),
  runtime?: string(name='runtime'),
  scaleConfig?: ScaleConfig(name='scaleConfig'),
  slsConfig?: SLSConfig(name='slsConfig'),
  startupProbe?: Probe(name='startupProbe'),
  timeout?: int32(name='timeout'),
  tracingConfig?: TracingConfig(name='tracingConfig'),
  vpcConfig?: VPCConfig(name='vpcConfig'),
}

model UpdateApplicationScaleConfigInput {
  alwaysAllocateCPU?: boolean(name='alwaysAllocateCPU'),
  maximumInstanceCount?: long(name='maximumInstanceCount'),
  minimumInstanceCount?: long(name='minimumInstanceCount'),
}

model UpdateApplicationTrafficConfigInput {
  additionalVersionWeight?: map[string]float(name='additionalVersionWeight'),
  resolvePolicy?: string(name='resolvePolicy'),
  routePolicy?: RoutePolicy(name='routePolicy'),
  versionId?: string(name='versionId'),
}

model UpdateAttributesInput {
  description?: string(name='description'),
  httpTriggerConfig?: HTTPTriggerConfig(name='httpTriggerConfig'),
  versionID?: string(name='versionID'),
}

model UpdateCustomDomainInput {
  applicationID?: string(name='applicationID'),
  applicationName?: string(name='applicationName'),
  certConfig?: CertConfig(name='certConfig'),
  keepFullPath?: boolean(name='keepFullPath'),
  namespaceID?: string(name='namespaceID'),
  protocol?: string(name='protocol'),
  tlsConfig?: TLSConfig(name='tlsConfig'),
  wafConfig?: WAFConfig(name='wafConfig'),
}

model UpdateWebApplicationInput {
  description?: string(name='Description', example='sae-app'),
  webNetworkConfig?: WebNetworkConfig(name='WebNetworkConfig'),
}

model UpdateWebApplicationScalingConfigInput {
  maximumInstanceCount?: long(name='MaximumInstanceCount', description='This parameter is required.', example='10'),
  minimumInstanceCount?: long(name='MinimumInstanceCount', description='This parameter is required.'),
}

model UpdateWebApplicationTrafficConfigInput {
  authType?: string(name='AuthType', example='Anonymous'),
  disableURLInternet?: boolean(name='DisableURLInternet'),
  revisionsTrafficWeight?: map[string]float(name='RevisionsTrafficWeight'),
  webAclConfig?: WebAclConfig(name='WebAclConfig'),
}

model UpdateWebCustomDomainInput {
  defaultForwardingAppName?: string(name='DefaultForwardingAppName'),
  protocol?: string(name='Protocol', example='HTTP'),
  routeConfig?: RouteConfig(name='RouteConfig'),
  webCertConfig?: WebCertConfig(name='WebCertConfig'),
  webTLSConfig?: WebTLSConfig(name='WebTLSConfig'),
  webWAFConfig?: WebWAFConfig(name='WebWAFConfig'),
}

model VPCConfig {
  anytunnelViaENI?: boolean(name='anytunnelViaENI'),
  role?: string(name='role'),
  securityGroupId?: string(name='securityGroupId'),
  vSwitchIds?: [ string ](name='vSwitchIds'),
  vpcId?: string(name='vpcId'),
}

model Version {
  createdTime?: string(name='createdTime'),
  description?: string(name='description'),
  image?: string(name='image'),
  lastModifiedTime?: string(name='lastModifiedTime'),
  requestId?: string(name='requestId'),
  versionId?: string(name='versionId'),
  weight?: double(name='weight'),
}

model VersionStatus {
  errorMessage?: string(name='errorMessage'),
  status?: string(name='status'),
}

model WAFConfig {
  enableWAF?: boolean(name='enableWAF'),
}

model WebAclConfig {
  webAclEntries?: [
    WebAclEntryConfig
  ](name='WebAclEntries', description='This parameter is required.', nullable=true),
}

model WebAclEntryConfig {
  entry?: string(name='Entry', description='This parameter is required.', example='1.2.3.4/32'),
}

model WebApplication {
  applicationId?: string(name='ApplicationId', description='This parameter is required.'),
  applicationName?: string(name='ApplicationName', description='This parameter is required.'),
  createdTime?: string(name='CreatedTime'),
  description?: string(name='Description'),
  internetURL?: string(name='InternetURL'),
  intranetURL?: string(name='IntranetURL'),
  lastModifiedTime?: string(name='LastModifiedTime'),
  namespaceId?: string(name='NamespaceId'),
  revisionConfig?: RevisionConfig(name='RevisionConfig'),
  vpcId?: string(name='VpcId'),
  webScalingConfig?: WebScalingConfig(name='WebScalingConfig'),
  webTrafficConfig?: WebTrafficConfig(name='WebTrafficConfig'),
}

model WebApplicationBody {
  code?: int32(name='Code'),
  data?: WebApplication(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationInstanceLogsBody {
  code?: int32(name='Code'),
  data?: DescribeInstanceLogsOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationResourceStaticsBody {
  code?: int32(name='Code'),
  data?: DescribeWebAppStaticsOutput(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationRevisionBody {
  code?: int32(name='Code'),
  data?: Revision(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationScalingConfigBody {
  code?: int32(name='Code'),
  data?: WebScalingConfig(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationStatus {
  instanceCount?: long(name='InstanceCount'),
  webScalingConfig?: WebScalingConfig(name='WebScalingConfig'),
}

model WebApplicationTrafficConfigBody {
  code?: int32(name='Code'),
  data?: WebTrafficConfig(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebApplicationWithInstanceCount {
  instanceCount?: long(name='InstanceCount'),
  webApplication?: WebApplication(name='WebApplication'),
}

model WebApplicationWithStatus {
  status?: WebApplicationStatus(name='Status'),
  webApplication?: WebApplication(name='WebApplication'),
}

model WebCertConfig {
  certName?: string(name='CertName'),
  certificate?: string(name='Certificate'),
  privateKey?: string(name='PrivateKey'),
}

model WebCustomDomain {
  createdTime?: string(name='CreatedTime', example='2023-03-30T08:02:19Z'),
  defaultForwardingAppName?: string(name='DefaultForwardingAppName', example='appxxxxx'),
  domainName?: string(name='DomainName', example='example.com'),
  lastModifiedTime?: string(name='LastModifiedTime', example='2023-03-30T08:02:19Z'),
  namespaceId?: string(name='NamespaceId'),
  protocol?: string(name='Protocol', example='HTTP'),
  routeConfig?: RouteConfig(name='RouteConfig'),
  webCertConfig?: WebCertConfig(name='WebCertConfig'),
  webTLSConfig?: WebTLSConfig(name='WebTLSConfig'),
  webWAFConfig?: WebWAFConfig(name='WebWAFConfig'),
  accountId?: string(name='accountId', example='123xxxxxx'),
}

model WebCustomDomainBody {
  code?: int32(name='Code'),
  data?: WebCustomDomain(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model WebInstanceInfo {
  imageUrl?: string(name='ImageUrl'),
  instanceId?: string(name='InstanceId', example='c-66691780-1522405d-3021e147e0c3'),
  status?: string(name='Status'),
  versionId?: string(name='VersionId', example='1'),
}

model WebLogEntry {
  message?: string(name='Message'),
}

model WebNASConfig {
  mountPoints?: [
    WebNASMountPoint
  ](name='MountPoints'),
}

model WebNASMountPoint {
  mountDir?: string(name='MountDir'),
  nasAddr?: string(name='NasAddr'),
  nasPath?: string(name='NasPath'),
}

model WebNetworkConfig {
  internetAccess?: boolean(name='InternetAccess', example='true'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-bp18hj1wtxgy3b0***'),
  vSwitchIds?: [ string ](name='VSwitchIds'),
}

model WebOSSConfig {
  mountPoints?: [
    WebOSSMountPoint
  ](name='MountPoints'),
}

model WebOSSMountPoint {
  bucketName?: string(name='BucketName'),
  bucketPath?: string(name='BucketPath'),
  mountDir?: string(name='MountDir'),
  readOnly?: boolean(name='ReadOnly'),
}

model WebScalingConfig {
  maximumInstanceCount?: long(name='MaximumInstanceCount', example='10'),
  minimumInstanceCount?: long(name='MinimumInstanceCount'),
}

model WebStaticsInfo {
  cpuUsage?: long(name='CpuUsage'),
  internetTrafficOut?: long(name='InternetTrafficOut'),
  invocations?: long(name='Invocations'),
  memoryUsage?: long(name='MemoryUsage'),
}

model WebTLSConfig {
  cipherSuites?: [ string ](name='CipherSuites'),
  maxVersion?: string(name='MaxVersion'),
  minVersion?: string(name='MinVersion'),
}

model WebTrafficConfig {
  authType?: string(name='AuthType', example='Anonymous'),
  disableInternetURL?: boolean(name='DisableInternetURL'),
  revisionsTrafficWeight?: map[string]float(name='RevisionsTrafficWeight'),
  webAclConfig?: WebAclConfig(name='WebAclConfig'),
}

model WebVersionStatus {
  errorMessage?: string(name='ErrorMessage'),
  status?: string(name='Status'),
}

model WebWAFConfig {
  enableWAF?: boolean(name='EnableWAF'),
}

model AbortAndRollbackChangeOrderRequest {
  changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.

This parameter is required.', example='ba386059-69b1-4e65-b1e5-0682d9fa****'),
}

model AbortAndRollbackChangeOrderResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='ba386059-69b1-4e65-b1e5-0682d9fa****'),
  }(name='Data', description='The details of the change order.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.', example='success'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the change order was terminated. Valid values:

*   **true**: The change order was terminated.
*   **false**: The change order failed to be terminated.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model AbortAndRollbackChangeOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AbortAndRollbackChangeOrderResponseBody(name='body'),
}

/**
 * @summary Terminates a change order and rolls back the corresponding application.
 *
 * @param request AbortAndRollbackChangeOrderRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AbortAndRollbackChangeOrderResponse
 */
async function abortAndRollbackChangeOrderWithOptions(request: AbortAndRollbackChangeOrderRequest, headers: map[string]string, runtime: $RuntimeOptions): AbortAndRollbackChangeOrderResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.changeOrderId)) {
    query['ChangeOrderId'] = request.changeOrderId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AbortAndRollbackChangeOrder',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/AbortAndRollbackChangeOrder`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates a change order and rolls back the corresponding application.
 *
 * @param request AbortAndRollbackChangeOrderRequest
 * @return AbortAndRollbackChangeOrderResponse
 */
async function abortAndRollbackChangeOrder(request: AbortAndRollbackChangeOrderRequest): AbortAndRollbackChangeOrderResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return abortAndRollbackChangeOrderWithOptions(request, headers, runtime);
}

model AbortChangeOrderRequest {
  changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.

This parameter is required.', example='be2e1c76-682b-4897-98d3-1d8d6478****'),
}

model AbortChangeOrderResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='be2e1c76-682b-4897-98d3-1d8d6478****'),
  }(name='Data', description='The data returned.'),
  errorCode?: string(name='ErrorCode', description='The error code. Value values:

*   **ErrorCode** is not returned if a request is successful.
*   **ErrorCode** is returned if a request failed. For more information, see **Error code** section of this topic.'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the change order was terminated. Valid values:

*   **true**: The change order was terminated.
*   **false**: The change order failed to be terminated.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace.', example='0a98a02315955564772843261e****'),
}

model AbortChangeOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AbortChangeOrderResponseBody(name='body'),
}

/**
 * @summary Terminate a change order.
 *
 * @param request AbortChangeOrderRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AbortChangeOrderResponse
 */
async function abortChangeOrderWithOptions(request: AbortChangeOrderRequest, headers: map[string]string, runtime: $RuntimeOptions): AbortChangeOrderResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.changeOrderId)) {
    query['ChangeOrderId'] = request.changeOrderId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AbortChangeOrder',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/AbortChangeOrder`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminate a change order.
 *
 * @param request AbortChangeOrderRequest
 * @return AbortChangeOrderResponse
 */
async function abortChangeOrder(request: AbortChangeOrderRequest): AbortChangeOrderResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return abortChangeOrderWithOptions(request, headers, runtime);
}

model BatchStartApplicationsRequest {
  appIds?: string(name='AppIds', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='ebf491f0-c1a5-45e2-b2c4-710dbe2a****'),
  namespaceId?: string(name='NamespaceId', description='The ID of the request.

This parameter is required.', example='cn-shanghai'),
  version?: string(name='Version', description='The application version.', example='1.0'),
}

model BatchStartApplicationsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

- **2xx**: The call was successful.
- **3xx**: The call was redirected.
- **4xx**: The call failed.
- **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The error code.

*   If the request is successful, this parameter is not returned.****
*   This parameter is returned only if the request failed.**** For more information, see **Error codes** in this topic.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

- The ErrorCode parameter is not returned if the request succeeds.
- If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section of this topic.', example='NULL'),
  message?: string(name='Message', description='The returned data.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the trace. It is used to query the details of a request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application deployment is successful. Take note of the following rules:

- **true**
- **false**', example='true'),
  traceId?: string(name='TraceId', description='The ID of the change order.', example='0a98a02315955564772843261e****'),
}

model BatchStartApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStartApplicationsResponseBody(name='body'),
}

/**
 * @summary cn-shanghai
 *
 * @param request BatchStartApplicationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStartApplicationsResponse
 */
async function batchStartApplicationsWithOptions(request: BatchStartApplicationsRequest, headers: map[string]string, runtime: $RuntimeOptions): BatchStartApplicationsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appIds)) {
    query['AppIds'] = request.appIds;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.version)) {
    query['Version'] = request.version;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStartApplications',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/batchStartApplications`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary cn-shanghai
 *
 * @param request BatchStartApplicationsRequest
 * @return BatchStartApplicationsResponse
 */
async function batchStartApplications(request: BatchStartApplicationsRequest): BatchStartApplicationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return batchStartApplicationsWithOptions(request, headers, runtime);
}

model BatchStopApplicationsRequest {
  appIds?: string(name='AppIds', description='The ID of the request.', example='ebf491f0-c1a5-45e2-b2c4-710dbe2a****'),
  namespaceId?: string(name='NamespaceId', description='ebf491f0-c1a5-45e2-b2c4-710dbe2a\\\\*\\\\*\\\\*\\\\*,ebf491f0-c1a5-45e2-b2c4-71025e2a\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='cn-shanghai'),
  version?: string(name='Version', description='The application version.', example='1.0'),
}

model BatchStopApplicationsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

- **2xx**: The call was successful.
- **3xx**: The call was redirected.
- **4xx**: The call failed.
- **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The error code.

*   If the request is successful, this parameter is not returned.****
*   This parameter is returned only if the request failed.**** For more information, see the "**Error codes**" section in this topic.', example='4a815998-b468-4bea-b7d8-59f52a44****'),
  }(name='Data', description='The ID of the change order.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

- The ErrorCode parameter is not returned if the request succeeds.
- If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section of this topic.', example='Null'),
  message?: string(name='Message', description='The ID of the trace. It can be used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='7BD8F4C7-D84C-4D46-9885-8212997E****'),
  success?: boolean(name='Success', description='Indicates whether the application is created. Valid values

- **true**
- **false**', example='true'),
  traceId?: string(name='TraceId', description='The returned data.', example='0bc3b6e215637275918588187d****'),
}

model BatchStopApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchStopApplicationsResponseBody(name='body'),
}

/**
 * @summary Stops multiple applications at a time.
 *
 * @param request BatchStopApplicationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchStopApplicationsResponse
 */
async function batchStopApplicationsWithOptions(request: BatchStopApplicationsRequest, headers: map[string]string, runtime: $RuntimeOptions): BatchStopApplicationsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appIds)) {
    query['AppIds'] = request.appIds;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.version)) {
    query['Version'] = request.version;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchStopApplications',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/batchStopApplications`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stops multiple applications at a time.
 *
 * @param request BatchStopApplicationsRequest
 * @return BatchStopApplicationsResponse
 */
async function batchStopApplications(request: BatchStopApplicationsRequest): BatchStopApplicationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return batchStopApplicationsWithOptions(request, headers, runtime);
}

model BindSlbRequest {
  appId?: string(name='AppId', description='0099b7be-5f5b-4512-a7fc-56049ef1\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  internet?: string(name='Internet', description='[{"port":80,"targetPort":8080,"protocol":"TCP"}]', example='[{"port":80,"targetPort":8080,"protocol":"TCP"}]'),
  internetSlbChargeType?: string(name='InternetSlbChargeType'),
  internetSlbId?: string(name='InternetSlbId', description='lb-bp1tg0k6d9nqaw7l1\\\\*\\\\*\\\\*\\\\*', example='lb-bp1tg0k6d9nqaw7l1****'),
  intranet?: string(name='Intranet', description='[{"port":80,"targetPort":8080,"protocol":"TCP"}]', example='[{"port":80,"targetPort":8080,"protocol":"TCP"}]'),
  intranetSlbChargeType?: string(name='IntranetSlbChargeType'),
  intranetSlbId?: string(name='IntranetSlbId', description='lb-bp1tg0k6d9nqaw7l1\\\\*\\\\*\\\\*\\\\*', example='lb-bp1tg0k6d9nqaw7l1****'),
}

model BindSlbResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. It can be used to query the task status.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the SLB instance was successfully associated with the application. Valid values:

*   **true**: The SLB instance was successfully associated with the application.
*   **false**: The SLB instance could not be associated with the application.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It can be used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model BindSlbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindSlbResponseBody(name='body'),
}

/**
 * @param request BindSlbRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindSlbResponse
 */
async function bindSlbWithOptions(request: BindSlbRequest, headers: map[string]string, runtime: $RuntimeOptions): BindSlbResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.internet)) {
    query['Internet'] = request.internet;
  }
  if (!$isNull(request.internetSlbChargeType)) {
    query['InternetSlbChargeType'] = request.internetSlbChargeType;
  }
  if (!$isNull(request.internetSlbId)) {
    query['InternetSlbId'] = request.internetSlbId;
  }
  if (!$isNull(request.intranet)) {
    query['Intranet'] = request.intranet;
  }
  if (!$isNull(request.intranetSlbChargeType)) {
    query['IntranetSlbChargeType'] = request.intranetSlbChargeType;
  }
  if (!$isNull(request.intranetSlbId)) {
    query['IntranetSlbId'] = request.intranetSlbId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BindSlb',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/slb`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BindSlbRequest
 * @return BindSlbResponse
 */
async function bindSlb(request: BindSlbRequest): BindSlbResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return bindSlbWithOptions(request, headers, runtime);
}

model ConfirmPipelineBatchRequest {
  confirm?: boolean(name='Confirm', description='true

This parameter is required.', example='true'),
  pipelineId?: string(name='PipelineId', description='e2e-vds-feh-\\\\*\\\\*\\\\*

This parameter is required.', example='e2e-vds-feh-***'),
}

model ConfirmPipelineBatchResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    pipelineId?: string(name='PipelineId', description='The ID of the batch.', example='e2e-vds-feh-***'),
  }(name='Data', description='The batch information.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the processing of the next batch started as required. Valid values:

*   **true**: The processing started.
*   **false**: The processing could not start.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model ConfirmPipelineBatchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfirmPipelineBatchResponseBody(name='body'),
}

/**
 * @param request ConfirmPipelineBatchRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfirmPipelineBatchResponse
 */
async function confirmPipelineBatchWithOptions(request: ConfirmPipelineBatchRequest, headers: map[string]string, runtime: $RuntimeOptions): ConfirmPipelineBatchResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.confirm)) {
    query['Confirm'] = request.confirm;
  }
  if (!$isNull(request.pipelineId)) {
    query['PipelineId'] = request.pipelineId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ConfirmPipelineBatch',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/ConfirmPipelineBatch`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ConfirmPipelineBatchRequest
 * @return ConfirmPipelineBatchResponse
 */
async function confirmPipelineBatch(request: ConfirmPipelineBatchRequest): ConfirmPipelineBatchResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return confirmPipelineBatchWithOptions(request, headers, runtime);
}

model CreateApplicationRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='acs:ram::123456789012\\\\*\\\\*\\\\*\\\\*:role/adminrole', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='cri-xxxxxx', example='cri-xxxxxx'),
  appDescription?: string(name='AppDescription', description='This is a test description.', example='This is a test description.'),
  appName?: string(name='AppName', description='test

This parameter is required.', example='test'),
  appSource?: string(name='AppSource'),
  associateEip?: boolean(name='AssociateEip', description='true', example='true'),
  autoConfig?: boolean(name='AutoConfig', description='true', example='true'),
  baseAppId?: string(name='BaseAppId'),
  command?: string(name='Command', description='sleep', example='echo'),
  commandArgs?: string(name='CommandArgs', description='1d', example='["a","b"]'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  cpu?: int32(name='Cpu', description='1000', example='1000'),
  customHostAlias?: string(name='CustomHostAlias', description='[{"hostName":"samplehost","ip":"127.0.0.1"}]', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  customImageNetworkType?: string(name='CustomImageNetworkType'),
  deploy?: boolean(name='Deploy', description='true', example='true'),
  diskSize?: int32(name='DiskSize'),
  dotnet?: string(name='Dotnet'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='3.5.3', example='3.5.3'),
  enableCpuBurst?: boolean(name='EnableCpuBurst'),
  enableEbpf?: string(name='EnableEbpf'),
  enableNewArms?: boolean(name='EnableNewArms'),
  enableSidecarResourceIsolated?: boolean(name='EnableSidecarResourceIsolated'),
  envs?: string(name='Envs', description='[{"name":"envtmp","value":"0"}]', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', example='10'),
  imageUrl?: string(name='ImageUrl', description='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  initContainersConfig?: [
    InitContainerConfig
  ](name='InitContainersConfig'),
  jarStartArgs?: string(name='JarStartArgs', description='custom-args', example='custom-args'),
  jarStartOptions?: string(name='JarStartOptions', description='\\\\-Xms4G -Xmx4G', example='-Xms4G -Xmx4G'),
  jdk?: string(name='Jdk', description='Open JDK 8', example='Open JDK 8'),
  kafkaConfigs?: string(name='KafkaConfigs', example='{"kafkaEndpoint":"10.0.X.XXX:XXXX,10.0.X.XXX:XXXX,10.0.X.XXX:XXXX\\\\","kafkaInstanceId":"alikafka_pre-cn-7pp2l8kr****","kafkaConfigs":[{"logType":"file_log","logDir":"/tmp/a.log","kafkaTopic":"test2"},{"logType":"stdout","logDir":"","kafkaTopic":"test"}]}'),
  liveness?: string(name='Liveness', description='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}', example='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}'),
  memory?: int32(name='Memory', description='1024', example='1024'),
  microRegistration?: string(name='MicroRegistration', example='"0"'),
  microRegistrationConfig?: string(name='MicroRegistrationConfig'),
  microserviceEngineConfig?: string(name='MicroserviceEngineConfig'),
  mountDesc?: string(name='MountDesc', description='[{mountPath: "/tmp", nasPath: "/"}]', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='example.com', example='example.com'),
  namespaceId?: string(name='NamespaceId', description='cn-beijing:test', example='cn-beijing:test'),
  nasConfigs?: string(name='NasConfigs', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
  nasId?: string(name='NasId', description='KSAK\\\\*\\\\*\\\\*\\\\*', example='KSAK****'),
  newSaeVersion?: string(name='NewSaeVersion'),
  oidcRoleName?: string(name='OidcRoleName'),
  ossAkId?: string(name='OssAkId', description='xxxxxx', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='xxxxxx', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageType?: string(name='PackageType', description='FatJar

This parameter is required.', example='FatJar'),
  packageUrl?: string(name='PackageUrl', description='http://myoss.oss-cn-\\\\*\\\\*\\\\*\\\\*.aliyuncs.com/my-buc/2019-06-30/\\\\*\\\\*\\\\*\\\\*.jar', example='http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='1.0.0', example='1.0.0'),
  php?: string(name='Php', example='PHP-FPM 7.0'),
  phpArmsConfigLocation?: string(name='PhpArmsConfigLocation', description='/usr/local/etc/php/conf.d/arms.ini', example='/usr/local/etc/php/conf.d/arms.ini'),
  phpConfig?: string(name='PhpConfig', description='k1=v1', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='/usr/local/etc/php/php.ini', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='{"exec":{"command":["cat","/etc/group"]}}', example='{"exec":{"command":["cat","/etc/group"]}}'),
  preStop?: string(name='PreStop', description='{"exec":{"command":["cat","/etc/group"]}}', example='{"exec":{"command":["cat","/etc/group"]}}'),
  programmingLanguage?: string(name='ProgrammingLanguage', example='java'),
  pvtzDiscoverySvc?: string(name='PvtzDiscoverySvc', example='{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true}'),
  python?: string(name='Python', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', example='Flask==2.0'),
  readiness?: string(name='Readiness', description='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}', example='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}'),
  replicas?: int32(name='Replicas', description='1

This parameter is required.', example='1'),
  resourceType?: string(name='ResourceType'),
  saeVersion?: string(name='SaeVersion'),
  secretMountDesc?: string(name='SecretMountDesc'),
  securityGroupId?: string(name='SecurityGroupId', description='sg-wz969ngg2e49q5i4\\\\*\\\\*\\\\*\\\\*', example='sg-wz969ngg2e49q5i4****'),
  serviceTags?: string(name='ServiceTags'),
  sidecarContainersConfig?: [
    SidecarContainerConfig
  ](name='SidecarContainersConfig'),
  slsConfigs?: string(name='SlsConfigs', description='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='30', example='30'),
  timezone?: string(name='Timezone', description='Asia/Shanghai', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  vSwitchId?: string(name='VSwitchId', description='vsw-bp12mw1f8k3jgygk9\\\\*\\\\*\\\\*\\\\*', example='vsw-bp12mw1f8k3jgygk9****'),
  vpcId?: string(name='VpcId', description='vpc-bp1aevy8sofi8mh1q\\\\*\\\\*\\\\*\\\\*', example='vpc-bp1aevy8sofi8mh1q****'),
  warStartOptions?: string(name='WarStartOptions', description='CATALINA_OPTS=\\\\\\\\"$CATALINA_OPTS $Options\\\\\\\\" catalina.sh run', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='apache-tomcat-7.0.91', example='apache-tomcat-7.0.91'),
}

model CreateApplicationShrinkRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='acs:ram::123456789012\\\\*\\\\*\\\\*\\\\*:role/adminrole', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='cri-xxxxxx', example='cri-xxxxxx'),
  appDescription?: string(name='AppDescription', description='This is a test description.', example='This is a test description.'),
  appName?: string(name='AppName', description='test

This parameter is required.', example='test'),
  appSource?: string(name='AppSource'),
  associateEip?: boolean(name='AssociateEip', description='true', example='true'),
  autoConfig?: boolean(name='AutoConfig', description='true', example='true'),
  baseAppId?: string(name='BaseAppId'),
  command?: string(name='Command', description='sleep', example='echo'),
  commandArgs?: string(name='CommandArgs', description='1d', example='["a","b"]'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  cpu?: int32(name='Cpu', description='1000', example='1000'),
  customHostAlias?: string(name='CustomHostAlias', description='[{"hostName":"samplehost","ip":"127.0.0.1"}]', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  customImageNetworkType?: string(name='CustomImageNetworkType'),
  deploy?: boolean(name='Deploy', description='true', example='true'),
  diskSize?: int32(name='DiskSize'),
  dotnet?: string(name='Dotnet'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='3.5.3', example='3.5.3'),
  enableCpuBurst?: boolean(name='EnableCpuBurst'),
  enableEbpf?: string(name='EnableEbpf'),
  enableNewArms?: boolean(name='EnableNewArms'),
  enableSidecarResourceIsolated?: boolean(name='EnableSidecarResourceIsolated'),
  envs?: string(name='Envs', description='[{"name":"envtmp","value":"0"}]', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', example='10'),
  imageUrl?: string(name='ImageUrl', description='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  initContainersConfigShrink?: string(name='InitContainersConfig'),
  jarStartArgs?: string(name='JarStartArgs', description='custom-args', example='custom-args'),
  jarStartOptions?: string(name='JarStartOptions', description='\\\\-Xms4G -Xmx4G', example='-Xms4G -Xmx4G'),
  jdk?: string(name='Jdk', description='Open JDK 8', example='Open JDK 8'),
  kafkaConfigs?: string(name='KafkaConfigs', example='{"kafkaEndpoint":"10.0.X.XXX:XXXX,10.0.X.XXX:XXXX,10.0.X.XXX:XXXX\\\\","kafkaInstanceId":"alikafka_pre-cn-7pp2l8kr****","kafkaConfigs":[{"logType":"file_log","logDir":"/tmp/a.log","kafkaTopic":"test2"},{"logType":"stdout","logDir":"","kafkaTopic":"test"}]}'),
  liveness?: string(name='Liveness', description='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}', example='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}'),
  memory?: int32(name='Memory', description='1024', example='1024'),
  microRegistration?: string(name='MicroRegistration', example='"0"'),
  microRegistrationConfig?: string(name='MicroRegistrationConfig'),
  microserviceEngineConfig?: string(name='MicroserviceEngineConfig'),
  mountDesc?: string(name='MountDesc', description='[{mountPath: "/tmp", nasPath: "/"}]', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='example.com', example='example.com'),
  namespaceId?: string(name='NamespaceId', description='cn-beijing:test', example='cn-beijing:test'),
  nasConfigs?: string(name='NasConfigs', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
  nasId?: string(name='NasId', description='KSAK\\\\*\\\\*\\\\*\\\\*', example='KSAK****'),
  newSaeVersion?: string(name='NewSaeVersion'),
  oidcRoleName?: string(name='OidcRoleName'),
  ossAkId?: string(name='OssAkId', description='xxxxxx', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='xxxxxx', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageType?: string(name='PackageType', description='FatJar

This parameter is required.', example='FatJar'),
  packageUrl?: string(name='PackageUrl', description='http://myoss.oss-cn-\\\\*\\\\*\\\\*\\\\*.aliyuncs.com/my-buc/2019-06-30/\\\\*\\\\*\\\\*\\\\*.jar', example='http://myoss.oss-cn-****.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='1.0.0', example='1.0.0'),
  php?: string(name='Php', example='PHP-FPM 7.0'),
  phpArmsConfigLocation?: string(name='PhpArmsConfigLocation', description='/usr/local/etc/php/conf.d/arms.ini', example='/usr/local/etc/php/conf.d/arms.ini'),
  phpConfig?: string(name='PhpConfig', description='k1=v1', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='/usr/local/etc/php/php.ini', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='{"exec":{"command":["cat","/etc/group"]}}', example='{"exec":{"command":["cat","/etc/group"]}}'),
  preStop?: string(name='PreStop', description='{"exec":{"command":["cat","/etc/group"]}}', example='{"exec":{"command":["cat","/etc/group"]}}'),
  programmingLanguage?: string(name='ProgrammingLanguage', example='java'),
  pvtzDiscoverySvc?: string(name='PvtzDiscoverySvc', example='{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true}'),
  python?: string(name='Python', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', example='Flask==2.0'),
  readiness?: string(name='Readiness', description='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}', example='{"exec":{"command":["sh","-c","cat /home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}'),
  replicas?: int32(name='Replicas', description='1

This parameter is required.', example='1'),
  resourceType?: string(name='ResourceType'),
  saeVersion?: string(name='SaeVersion'),
  secretMountDesc?: string(name='SecretMountDesc'),
  securityGroupId?: string(name='SecurityGroupId', description='sg-wz969ngg2e49q5i4\\\\*\\\\*\\\\*\\\\*', example='sg-wz969ngg2e49q5i4****'),
  serviceTags?: string(name='ServiceTags'),
  sidecarContainersConfigShrink?: string(name='SidecarContainersConfig'),
  slsConfigs?: string(name='SlsConfigs', description='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='30', example='30'),
  timezone?: string(name='Timezone', description='Asia/Shanghai', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  vSwitchId?: string(name='VSwitchId', description='vsw-bp12mw1f8k3jgygk9\\\\*\\\\*\\\\*\\\\*', example='vsw-bp12mw1f8k3jgygk9****'),
  vpcId?: string(name='VpcId', description='vpc-bp1aevy8sofi8mh1q\\\\*\\\\*\\\\*\\\\*', example='vpc-bp1aevy8sofi8mh1q****'),
  warStartOptions?: string(name='WarStartOptions', description='CATALINA_OPTS=\\\\\\\\"$CATALINA_OPTS $Options\\\\\\\\" catalina.sh run', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='apache-tomcat-7.0.91', example='apache-tomcat-7.0.91'),
}

model CreateApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The ID of the application that is created.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. It can be used to query the task status.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application is created. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model CreateApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicationResponseBody(name='body'),
}

/**
 * @param tmpReq CreateApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApplicationResponse
 */
async function createApplicationWithOptions(tmpReq: CreateApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateApplicationResponse {
  tmpReq.validate();
  var request = new CreateApplicationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.initContainersConfig)) {
    request.initContainersConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.initContainersConfig, 'InitContainersConfig', 'json');
  }
  if (!$isNull(tmpReq.sidecarContainersConfig)) {
    request.sidecarContainersConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sidecarContainersConfig, 'SidecarContainersConfig', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.acrAssumeRoleArn)) {
    query['AcrAssumeRoleArn'] = request.acrAssumeRoleArn;
  }
  if (!$isNull(request.appDescription)) {
    query['AppDescription'] = request.appDescription;
  }
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.autoConfig)) {
    query['AutoConfig'] = request.autoConfig;
  }
  if (!$isNull(request.command)) {
    query['Command'] = request.command;
  }
  if (!$isNull(request.commandArgs)) {
    query['CommandArgs'] = request.commandArgs;
  }
  if (!$isNull(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!$isNull(request.customHostAlias)) {
    query['CustomHostAlias'] = request.customHostAlias;
  }
  if (!$isNull(request.customImageNetworkType)) {
    query['CustomImageNetworkType'] = request.customImageNetworkType;
  }
  if (!$isNull(request.deploy)) {
    query['Deploy'] = request.deploy;
  }
  if (!$isNull(request.diskSize)) {
    query['DiskSize'] = request.diskSize;
  }
  if (!$isNull(request.dotnet)) {
    query['Dotnet'] = request.dotnet;
  }
  if (!$isNull(request.edasContainerVersion)) {
    query['EdasContainerVersion'] = request.edasContainerVersion;
  }
  if (!$isNull(request.enableCpuBurst)) {
    query['EnableCpuBurst'] = request.enableCpuBurst;
  }
  if (!$isNull(request.enableEbpf)) {
    query['EnableEbpf'] = request.enableEbpf;
  }
  if (!$isNull(request.enableNewArms)) {
    query['EnableNewArms'] = request.enableNewArms;
  }
  if (!$isNull(request.envs)) {
    query['Envs'] = request.envs;
  }
  if (!$isNull(request.imagePullSecrets)) {
    query['ImagePullSecrets'] = request.imagePullSecrets;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.jarStartArgs)) {
    query['JarStartArgs'] = request.jarStartArgs;
  }
  if (!$isNull(request.jarStartOptions)) {
    query['JarStartOptions'] = request.jarStartOptions;
  }
  if (!$isNull(request.jdk)) {
    query['Jdk'] = request.jdk;
  }
  if (!$isNull(request.kafkaConfigs)) {
    query['KafkaConfigs'] = request.kafkaConfigs;
  }
  if (!$isNull(request.liveness)) {
    query['Liveness'] = request.liveness;
  }
  if (!$isNull(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!$isNull(request.microRegistration)) {
    query['MicroRegistration'] = request.microRegistration;
  }
  if (!$isNull(request.microserviceEngineConfig)) {
    query['MicroserviceEngineConfig'] = request.microserviceEngineConfig;
  }
  if (!$isNull(request.mountDesc)) {
    query['MountDesc'] = request.mountDesc;
  }
  if (!$isNull(request.mountHost)) {
    query['MountHost'] = request.mountHost;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.nasConfigs)) {
    query['NasConfigs'] = request.nasConfigs;
  }
  if (!$isNull(request.nasId)) {
    query['NasId'] = request.nasId;
  }
  if (!$isNull(request.newSaeVersion)) {
    query['NewSaeVersion'] = request.newSaeVersion;
  }
  if (!$isNull(request.oidcRoleName)) {
    query['OidcRoleName'] = request.oidcRoleName;
  }
  if (!$isNull(request.packageType)) {
    query['PackageType'] = request.packageType;
  }
  if (!$isNull(request.packageUrl)) {
    query['PackageUrl'] = request.packageUrl;
  }
  if (!$isNull(request.packageVersion)) {
    query['PackageVersion'] = request.packageVersion;
  }
  if (!$isNull(request.phpArmsConfigLocation)) {
    query['PhpArmsConfigLocation'] = request.phpArmsConfigLocation;
  }
  if (!$isNull(request.phpConfigLocation)) {
    query['PhpConfigLocation'] = request.phpConfigLocation;
  }
  if (!$isNull(request.postStart)) {
    query['PostStart'] = request.postStart;
  }
  if (!$isNull(request.preStop)) {
    query['PreStop'] = request.preStop;
  }
  if (!$isNull(request.programmingLanguage)) {
    query['ProgrammingLanguage'] = request.programmingLanguage;
  }
  if (!$isNull(request.pvtzDiscoverySvc)) {
    query['PvtzDiscoverySvc'] = request.pvtzDiscoverySvc;
  }
  if (!$isNull(request.python)) {
    query['Python'] = request.python;
  }
  if (!$isNull(request.pythonModules)) {
    query['PythonModules'] = request.pythonModules;
  }
  if (!$isNull(request.readiness)) {
    query['Readiness'] = request.readiness;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.saeVersion)) {
    query['SaeVersion'] = request.saeVersion;
  }
  if (!$isNull(request.secretMountDesc)) {
    query['SecretMountDesc'] = request.secretMountDesc;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.slsConfigs)) {
    query['SlsConfigs'] = request.slsConfigs;
  }
  if (!$isNull(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!$isNull(request.timezone)) {
    query['Timezone'] = request.timezone;
  }
  if (!$isNull(request.tomcatConfig)) {
    query['TomcatConfig'] = request.tomcatConfig;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.warStartOptions)) {
    query['WarStartOptions'] = request.warStartOptions;
  }
  if (!$isNull(request.webContainer)) {
    query['WebContainer'] = request.webContainer;
  }

  var body : map[string]any = {};
  if (!$isNull(request.acrInstanceId)) {
    body['AcrInstanceId'] = request.acrInstanceId;
  }
  if (!$isNull(request.associateEip)) {
    body['AssociateEip'] = request.associateEip;
  }
  if (!$isNull(request.baseAppId)) {
    body['BaseAppId'] = request.baseAppId;
  }
  if (!$isNull(request.configMapMountDesc)) {
    body['ConfigMapMountDesc'] = request.configMapMountDesc;
  }
  if (!$isNull(request.enableSidecarResourceIsolated)) {
    body['EnableSidecarResourceIsolated'] = request.enableSidecarResourceIsolated;
  }
  if (!$isNull(request.initContainersConfigShrink)) {
    body['InitContainersConfig'] = request.initContainersConfigShrink;
  }
  if (!$isNull(request.microRegistrationConfig)) {
    body['MicroRegistrationConfig'] = request.microRegistrationConfig;
  }
  if (!$isNull(request.ossAkId)) {
    body['OssAkId'] = request.ossAkId;
  }
  if (!$isNull(request.ossAkSecret)) {
    body['OssAkSecret'] = request.ossAkSecret;
  }
  if (!$isNull(request.ossMountDescs)) {
    body['OssMountDescs'] = request.ossMountDescs;
  }
  if (!$isNull(request.php)) {
    body['Php'] = request.php;
  }
  if (!$isNull(request.phpConfig)) {
    body['PhpConfig'] = request.phpConfig;
  }
  if (!$isNull(request.serviceTags)) {
    body['ServiceTags'] = request.serviceTags;
  }
  if (!$isNull(request.sidecarContainersConfigShrink)) {
    body['SidecarContainersConfig'] = request.sidecarContainersConfigShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/createApplication`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateApplicationRequest
 * @return CreateApplicationResponse
 */
async function createApplication(request: CreateApplicationRequest): CreateApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createApplicationWithOptions(request, headers, runtime);
}

model CreateApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  enableIdle?: boolean(name='EnableIdle'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', example='3'),
  scalingRuleEnable?: boolean(name='ScalingRuleEnable', example='true'),
  scalingRuleMetric?: string(name='ScalingRuleMetric', example='{"maxReplicas":3,"minReplicas":1,"metrics":[{"metricType":"CPU","metricTargetAverageUtilization":20},{"metricType":"MEMORY","metricTargetAverageUtilization":30},{"metricType":"tcpActiveConn","metricTargetAverageUtilization":20},{"metricType":"SLB_QPS","MetricTargetAverageUtilization":25,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","SlbLogstore":"function-log","Vport":"80"},{"metricType":"SLB_RT","MetricTargetAverageUtilization":35,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","SlbLogstore":"function-log","Vport":"80"}],"scaleUpRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":0},"scaleDownRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":300}}'),
  scalingRuleName?: string(name='ScalingRuleName', description='This parameter is required.', example='timer-0800-2100'),
  scalingRuleTimer?: string(name='ScalingRuleTimer', example='{"beginDate":null,"endDate":null,"period":"* * *","schedules":[{"atTime":"08:00","targetReplicas":10},{"atTime":"20:00","targetReplicas":3}]}'),
  scalingRuleType?: string(name='ScalingRuleType', description='This parameter is required.', example='timing'),
}

model CreateApplicationScalingRuleResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    appId?: string(name='AppId', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    createTime?: long(name='CreateTime', example='1616642248938'),
    enableIdle?: boolean(name='EnableIdle'),
    lastDisableTime?: long(name='LastDisableTime', example='1641882854484'),
    metric?: {
      maxReplicas?: int32(name='MaxReplicas', example='3'),
      metrics?: [ 
        {
          metricTargetAverageUtilization?: int32(name='MetricTargetAverageUtilization', example='20'),
          metricType?: string(name='MetricType', example='CPU'),
          slbId?: string(name='SlbId', example='lb-xxx'),
          slbLogstore?: string(name='SlbLogstore', example='test'),
          slbProject?: string(name='SlbProject', example='test'),
          vport?: string(name='Vport', example='80'),
        }
      ](name='Metrics'),
      minReplicas?: int32(name='MinReplicas', example='1'),
    }(name='Metric'),
    scaleRuleEnabled?: boolean(name='ScaleRuleEnabled', example='true'),
    scaleRuleName?: string(name='ScaleRuleName', example='test'),
    scaleRuleType?: string(name='ScaleRuleType', example='timing'),
    timer?: {
      beginDate?: string(name='BeginDate', example='2021-03-25'),
      endDate?: string(name='EndDate', example='2021-04-25'),
      period?: string(name='Period', example='* * *'),
      schedules?: [ 
        {
          atTime?: string(name='AtTime', example='08:00'),
          maxReplicas?: int32(name='MaxReplicas', example='10'),
          minReplicas?: int32(name='MinReplicas', example='5'),
          targetReplicas?: int32(name='TargetReplicas', example='3'),
        }
      ](name='Schedules'),
    }(name='Timer'),
    updateTime?: long(name='UpdateTime', example='1616642248938'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model CreateApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @summary Null
 *
 * @description The HTTP status code. Take note of the following rules:
 * *   **2xx**: The call was successful.
 * *   **3xx**: The call was redirected.
 * *   **4xx**: The call failed.
 * *   **5xx**: A server error occurred.
 *
 * @param request CreateApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateApplicationScalingRuleResponse
 */
async function createApplicationScalingRuleWithOptions(request: CreateApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.enableIdle)) {
    query['EnableIdle'] = request.enableIdle;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }
  if (!$isNull(request.scalingRuleEnable)) {
    query['ScalingRuleEnable'] = request.scalingRuleEnable;
  }
  if (!$isNull(request.scalingRuleMetric)) {
    query['ScalingRuleMetric'] = request.scalingRuleMetric;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }
  if (!$isNull(request.scalingRuleTimer)) {
    query['ScalingRuleTimer'] = request.scalingRuleTimer;
  }
  if (!$isNull(request.scalingRuleType)) {
    query['ScalingRuleType'] = request.scalingRuleType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/applicationScalingRule`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Null
 *
 * @description The HTTP status code. Take note of the following rules:
 * *   **2xx**: The call was successful.
 * *   **3xx**: The call was redirected.
 * *   **4xx**: The call failed.
 * *   **5xx**: A server error occurred.
 *
 * @param request CreateApplicationScalingRuleRequest
 * @return CreateApplicationScalingRuleResponse
 */
async function createApplicationScalingRule(request: CreateApplicationScalingRuleRequest): CreateApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createApplicationScalingRuleWithOptions(request, headers, runtime);
}

model CreateConfigMapRequest {
  data?: string(name='Data', description='The ConfigMap data.

This parameter is required.', example='{"env.shell": "/bin/sh"}'),
  description?: string(name='Description', description='The key-value pairs of the ConfigMap in the JSON format. Format:

{"Data":"{"k1":"v1", "k2":"v2"}"}

k specifies a key and v specifies a value. For more information, see [Manage a Kubernetes ConfigMap](https://help.aliyun.com/document_detail/171326.html).', example='test-desc'),
  name?: string(name='Name', description='The name of the ConfigMap. The name can contain digits, letters, and underscores (_). The name must start with a letter.

This parameter is required.', example='name'),
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace to which the ConfigMap instance belongs.

This parameter is required.', example='cn-hangzhou'),
}

model CreateConfigMapResponseBody = {
  code?: string(name='Code', description='Empty', example='200'),
  data?: {
    configMapId?: long(name='ConfigMapId', description='The returned result.', example='1'),
  }(name='Data', description='The trace ID that is used to query the details of the request.'),
  errorCode?: string(name='ErrorCode', description='The ID of the ConfigMap that was created.', example='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The request ID.', example='success'),
  requestId?: string(name='RequestId', description='The returned data.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='true'),
  traceId?: string(name='TraceId', description='The returned message.', example='0a98a02315955564772843261e****'),
}

model CreateConfigMapResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateConfigMapResponseBody(name='body'),
}

/**
 * @summary Create a ConfigMap in a namespace.
 *
 * @param request CreateConfigMapRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateConfigMapResponse
 */
async function createConfigMapWithOptions(request: CreateConfigMapRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateConfigMapResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.data)) {
    body['Data'] = request.data;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateConfigMap',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/configmap/configMap`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create a ConfigMap in a namespace.
 *
 * @param request CreateConfigMapRequest
 * @return CreateConfigMapResponse
 */
async function createConfigMap(request: CreateConfigMapRequest): CreateConfigMapResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createConfigMapWithOptions(request, headers, runtime);
}

model CreateGreyTagRouteRequest {
  albRules?: string(name='AlbRules', description='The canary release rule of the application for which Application Load Balancer (ALB) gateway routing is configured.', example='[{"condition":"AND","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"sourceIp","value":"127.0.0.1"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}]'),
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='7802c49a-67bc-4167-8369-9a9c003c****'),
  description?: string(name='Description', description='The description of the canary release rule. The name must be 1 to 64 characters in length.', example='灰度发布-地域灰度'),
  dubboRules?: string(name='DubboRules', description='The canary release rule that you created for Dubbo applications. If your application uses the Dubbo framework, you must configure this parameter. You do not need to configure the **ScRules** parameter.', example='[{"condition":"OR","group":"DUBBO","items":[{"cond":"==","expr":".key1","index":0,"operator":"rawvalue","value":"value1"},{"cond":"==","expr":".key2","index":0,"operator":"rawvalue","value":"value2"}],"methodName":"echo","serviceName":"com.alibaba.edas.boot.EchoService","version":"1.0.0"}]'),
  name?: string(name='Name', description='The name of the canary release rule. The name must start with a lowercase letter and end with a digit or a lowercase letter. The name can contain only lowercase letters, Chinese characters, digits, and hyphens (-). The name must be 1 to 64 characters in length.

This parameter is required.', example='dubbo-echo'),
  scRules?: string(name='ScRules', description='The canary release rule that you created for Spring Cloud application. If your application uses the Spring Cloud framework, you must configure this parameter. You do not need to configure the **DubboRules** parameter.', example='[{"condition":"OR","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"param","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}]'),
}

model CreateGreyTagRouteResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule. The ID is globally unique.', example='16'),
  }(name='Data', description='The information about the canary release rule.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   **ErrorCode** is not returned if a request is successful.
*   **ErrorCode** is returned if a request failed. For more information, see **Error code** section of this topic.'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9D29CBD0-45D3-410B-9826-52F86F90****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model CreateGreyTagRouteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGreyTagRouteResponseBody(name='body'),
}

/**
 * @summary Creates a canary release rule for a Spring Cloud or Dubbo application.
 *
 * @description >  You can configure only one canary release rule for each application.
 *
 * @param request CreateGreyTagRouteRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGreyTagRouteResponse
 */
async function createGreyTagRouteWithOptions(request: CreateGreyTagRouteRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateGreyTagRouteResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.albRules)) {
    query['AlbRules'] = request.albRules;
  }
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.dubboRules)) {
    query['DubboRules'] = request.dubboRules;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.scRules)) {
    query['ScRules'] = request.scRules;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateGreyTagRoute',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/tagroute/greyTagRoute`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a canary release rule for a Spring Cloud or Dubbo application.
 *
 * @description >  You can configure only one canary release rule for each application.
 *
 * @param request CreateGreyTagRouteRequest
 * @return CreateGreyTagRouteResponse
 */
async function createGreyTagRoute(request: CreateGreyTagRouteRequest): CreateGreyTagRouteResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createGreyTagRouteWithOptions(request, headers, runtime);
}

model CreateIngressRequest {
  addressType?: string(name='AddressType'),
  certId?: string(name='CertId', description='The ID of the certificate that is associated with the **CLB** instance.

*   If you set **LoadBalanceType** to **clb**, you can use CertId to configure a certificate for the HTTPS listener.

For more information about how to manage the SSL certificate IDs that are used by CLB instances, see [Overview](https://help.aliyun.com/document_detail/90792.html).', example='188077086902****_176993d****_181437****_108724****'),
  certIds?: string(name='CertIds', description='The IDs of the certificates that are associated with the **ALB** instance.

*   If you set **LoadBalanceType** to **alb**, you can use CertIds to configure multiple certificates for the HTTPS listener. Separate multiple certificate IDs with commas (,).
*   The ID of the SSL certificate that is used by an ALB instance can be obtained from Certificate Management Service. For example, if you specify `756***-cn-hangzhou`, `756***` is the certificate ID that is obtained from the service page, and `-cn-hangzhou` is the fixed suffix. For more information, see [Manage certificates](https://help.aliyun.com/document_detail/209076.html).', example='87***35-cn-hangzhou,812***3-cn-hangzhou'),
  corsConfig?: string(name='CorsConfig'),
  defaultRule?: string(name='DefaultRule', description='Default forwarding rule. Traffic is forwarded to the specified application through a designated port based on the IP address. Parameter descriptions are as follows:
- **appId**: Application ID. - **containerPort**: Application instance port.
> All requests that do not match or do not meet the **Rules** for forwarding will be directed to this specified application.

This parameter is required.', example='{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080}'),
  description?: string(name='Description', description='Route rule name.', example='ingress-for-sae-test'),
  enableXForwardedFor?: boolean(name='EnableXForwardedFor'),
  enableXForwardedForClientSrcPort?: boolean(name='EnableXForwardedForClientSrcPort'),
  enableXForwardedForProto?: boolean(name='EnableXForwardedForProto'),
  enableXForwardedForSlbId?: boolean(name='EnableXForwardedForSlbId'),
  enableXForwardedForSlbPort?: boolean(name='EnableXForwardedForSlbPort'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds Valid values: 1 to 60. If no requests are received within the specified timeout period, ALB closes the current connection. When a new request is received, ALB establishes a new connection.', example='15'),
  listenerPort?: int32(name='ListenerPort', description='SThe frontend port that is used by the ALB instance.
Valid values: 1 to 65535.

This parameter is required.', example='80'),
  listenerProtocol?: string(name='ListenerProtocol', description='Request forwarding protocol. The value description is as follows:
- **HTTP**: Suitable for applications that need to identify data content. - **HTTPS**: Suitable for applications that require encrypted transmission.', example='HTTP'),
  loadBalanceType?: string(name='LoadBalanceType', description='The type of the SLB instance. The instance type can be specified only when you create a routing rule. You cannot change the instance type when you update the routing rule. Valid values:

*   **clb**
*   **alb**', example='clb'),
  loadBalancerEdition?: string(name='LoadBalancerEdition'),
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace where the application is located. Currently, cross-namespace applications are not supported.

This parameter is required.', example='cn-beijing:sae-test'),
  requestTimeout?: int32(name='RequestTimeout', description='The timeout period of a request. Unit: seconds. Valid values: 1 to 180. If no response is received from the backend server within the specified timeout period, ALB stops waiting for the response and returns an HTTP 504 error code to the client.', example='3'),
  rules?: string(name='Rules', description='The forwarding rules. You can specify a port and an application in a forwarding rule to forward traffic based on the specified domain name and request path. The following list describes the involved parameters:

*   **appId**: the ID of the application.
*   **containerPort**: the container port of the application.
*   **domain**: the domain name.
*   **path**: the request path.
*   **backendProtocol**: the backend service protocol. Valid values: http, https, and grpc. Default value: http.
*   **rewritePath**: the rewrite path.

>  The path rewrite feature is supported only by ALB instances.

This parameter is required.', example='[{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080,"domain":"www.sae.site","path":"/path1"},{"appId":"666403ce-d25b-47cf-87fe-497565d2****","containerPort":8080,"domain":"sae.site","path":"/path2"}]'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of a security policy.', example='sp-bp1bpn0kn9****'),
  slbId?: string(name='SlbId', description='The Server Load Balancer (SLB) instance that is used by the routing rule.

>  The SLB instance can be a Classic Load Balancer (CLB) instance or an Application Load Balancer (ALB) instance.', example='lb-uf6hucc7inlqrtcq5****'),
  zoneMappings?: string(name='ZoneMappings'),
}

model CreateIngressResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    ingressId?: long(name='IngressId', description='The ID of the routing rule.', example='87'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='success'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the Secret is successfully deleted. Valid values:

*   **true**: The instance was deleted.
*   **false**: The instance failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model CreateIngressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIngressResponseBody(name='body'),
}

/**
 * @summary Creates a routing rule.
 *
 * @param request CreateIngressRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIngressResponse
 */
async function createIngressWithOptions(request: CreateIngressRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateIngressResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!$isNull(request.certIds)) {
    query['CertIds'] = request.certIds;
  }
  if (!$isNull(request.corsConfig)) {
    query['CorsConfig'] = request.corsConfig;
  }
  if (!$isNull(request.defaultRule)) {
    query['DefaultRule'] = request.defaultRule;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.enableXForwardedFor)) {
    query['EnableXForwardedFor'] = request.enableXForwardedFor;
  }
  if (!$isNull(request.enableXForwardedForClientSrcPort)) {
    query['EnableXForwardedForClientSrcPort'] = request.enableXForwardedForClientSrcPort;
  }
  if (!$isNull(request.enableXForwardedForProto)) {
    query['EnableXForwardedForProto'] = request.enableXForwardedForProto;
  }
  if (!$isNull(request.enableXForwardedForSlbId)) {
    query['EnableXForwardedForSlbId'] = request.enableXForwardedForSlbId;
  }
  if (!$isNull(request.enableXForwardedForSlbPort)) {
    query['EnableXForwardedForSlbPort'] = request.enableXForwardedForSlbPort;
  }
  if (!$isNull(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.listenerPort)) {
    query['ListenerPort'] = request.listenerPort;
  }
  if (!$isNull(request.listenerProtocol)) {
    query['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalanceType)) {
    query['LoadBalanceType'] = request.loadBalanceType;
  }
  if (!$isNull(request.loadBalancerEdition)) {
    query['LoadBalancerEdition'] = request.loadBalancerEdition;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.slbId)) {
    query['SlbId'] = request.slbId;
  }
  if (!$isNull(request.zoneMappings)) {
    query['ZoneMappings'] = request.zoneMappings;
  }

  var body : map[string]any = {};
  if (!$isNull(request.rules)) {
    body['Rules'] = request.rules;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateIngress',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/ingress/Ingress`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a routing rule.
 *
 * @param request CreateIngressRequest
 * @return CreateIngressResponse
 */
async function createIngress(request: CreateIngressRequest): CreateIngressResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createIngressWithOptions(request, headers, runtime);
}

model CreateJobRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) required for a RAM role to obtain images across accounts. For more information, see [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='The ID of Container Registry Enterprise Edition instance N. This parameter is required when the **ImageUrl** parameter is set to the URL of an image in an ACR Enterprise Edition instance.', example='cri-xxxxxx'),
  appDescription?: string(name='AppDescription', description='The description of the template. The description cannot exceed 1,024 characters in length.', example='This is a test description.'),
  appName?: string(name='AppName', description='The name of the job template. The name can contain digits, letters, and hyphens (-). The name must start with a letter and cannot exceed 36 characters in length.

This parameter is required.', example='test'),
  autoConfig?: boolean(name='AutoConfig', description='Specifies whether to automatically configure the network environment. Take note of the following rules:

*   **true**: The network environment is automatically configured by SAE when the application is created. In this case, the values of the **NamespaceId**, **VpcId**, **vSwitchId**, and **SecurityGroupId** parameters are ignored.
*   **false**: The network environment is manually configured based on your settings when the application is created.', example='false'),
  backoffLimit?: long(name='BackoffLimit', description='The number of times the job is retried.', example='3'),
  command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Sample statements:

    command:
          - echo
          - abc
          - >
          - file0

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
  commandArgs?: string(name='CommandArgs', description='The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the **Command** parameter. You can specify the name in one of the following formats:

`["a","b"]`

In the preceding example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. This parameter is optional.', example='["a","b"]'),
  concurrencyPolicy?: string(name='ConcurrencyPolicy', description='The concurrency policy of the job. Take note of the following rules:

*   **Forbid**: Prohibits concurrent running. If the previous job is not completed, no new job is created.
*   **Allow**: Allows concurrent running.
*   **Replace**: If the previous job is not completed when the time to create a new job is reached, the new job replaces the previous job.', example='Allow'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='The description of the **ConfigMap** instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following table describes the parameters that are used in the preceding statements.

*   **congfigMapId**: the ID of the ConfigMap instance. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID.
*   **key**: the key.

> You can use the `sae-sys-configmap-all` key to mount all keys.

*   **mountPath**: the mount path in the container.', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. You cannot set this parameter to 0. Valid values:

*   500
*   1000
*   2000
*   4000
*   8000
*   16000
*   32000', example='1000'),
  customHostAlias?: string(name='CustomHostAlias', description='The custom mappings between hostnames and IP addresses in the container. Take note of the following rules:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
  enableImageAccl?: boolean(name='EnableImageAccl', example='false'),
  envs?: string(name='Envs', description='The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see [CreateConfigMap](https://help.aliyun.com/document_detail/176914.html). Take note of the following rules:

*   Customize

    *   **name**: the name of the environment variable.
    *   **value**: the value of the environment variable.

*   Reference ConfigMap

    *   **name**: the name of the environment variable. You can reference one or all keys. If you want to reference all keys, specify `sae-sys-configmap-all-<ConfigMap name>`. Example: `sae-sys-configmap-all-test1`.
    *   **valueFrom**: the reference of the environment variable. Set the value to `configMapRef`.
    *   **configMapId**: the ConfigMap ID.
    *   **key**: the key. If you want to reference all keys, do not configure this parameter.', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', description='The ID of the corresponding Secret.', example='10'),
  imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if the **PackageType** parameter is set to **Image**.', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Xms4G -Xmx4G'),
  jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='custom-option'),
  jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
  memory?: int32(name='Memory', description='The size of memory required by each instance. Unit: MB. You cannot set this parameter to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   Set the value to 1024 when Cpu is set to 500 or 1000.
*   Set the value to 2048 when Cpu is set to 500, 1000 or 2000.
*   Set the value to 4096 when Cpu is set to 1000, 2000, or 4000.
*   Set the value to 8192 when Cpu is set to 2000, 4000, or 8000.
*   Set the value to 12288 when Cpu is set to 12000.
*   Set the value to 16384 when Cpu is set to 4000, 8000, or 16000.
*   Set the value to 24576 when Cpu is set to 12000.
*   Set the value to 32768 when Cpu is set to 16000.
*   Set the value to 65536 when Cpu is set to 8000, 16000, or 32000.
*   Set the value to 131072 when Cpu is set to 32000.', example='1024'),
  mountDesc?: string(name='MountDesc', description='The configurations for mounting the NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **MountDesc** parameter in the requests. If you want to unmount the NAS file system, you must set the **MountDesc** values in the subsequent requests to an empty string ("").', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the **MountHost** parameter empty in the request.', example='10d3b4bc9****.com'),
  namespaceId?: string(name='NamespaceId', description='The ID of the Serverless App Engine (SAE) namespace. The ID can contain only lowercase letters and hyphens (-). It must start with a lowercase letter.', example='cn-beijing:test'),
  nasId?: string(name='NasId', description='The ID of the Apsara File Storage NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **NasId** parameter in the requests. If you want to unmount the NAS file system, you must set the **NasId** values in the subsequent requests to an empty string ("").', example='10d3b4****'),
  ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS buckets.', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='Information of the Object Storage Service (OSS) bucket mounted to the application. The following table describes the parameters that are used in the preceding statements.

*   **bucketName**: the name of the OSS bucket.

*   **bucketPath**: the directory or object in OSS. If the specified directory or object does not exist, an error is returned.

*   **mountPath**: the directory of the container in SAE. If the path already exists, the newly specified path overwrites the previous one. If the path does not exist, it is created.

*   **readOnly**: specifies whether to only allow the container path to read data from the OSS directory. Valid values:

    *   **true**: The container path only has read permission on the OSS directory.
    *   **false**: The application has read and write permissions.', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageType?: string(name='PackageType', description='The type of the deployment package. Take note of the following rules:

*   If you deploy the application by using a Java Archive (JAR) package, you can set this parameter to **FatJar**, **War**, or **Image**.
*   If you deploy the application by using a PHP package, you can set this parameter to one of the following values:

**PhpZip** **IMAGE_PHP_5_4** **IMAGE_PHP_5_4_ALPINE** **IMAGE_PHP_5_5** **IMAGE_PHP_5_5_ALPINE** **IMAGE_PHP_5_6** **IMAGE_PHP_5_6_ALPINE** **IMAGE_PHP_7_0** **IMAGE_PHP_7_0_ALPINE** **IMAGE_PHP_7_1** **IMAGE_PHP_7_1_ALPINE** **IMAGE_PHP_7_2** **IMAGE_PHP_7_2_ALPINE** **IMAGE_PHP_7_3** **IMAGE_PHP_7_3_ALPINE**

*   If you deploy the application by using a **Python** package, you can set this parameter to **PythonZip** or **Image**:

This parameter is required.', example='FatJar'),
  packageUrl?: string(name='PackageUrl', description='The address of the deployment package. This parameter is required if you set **PackageType** to **FatJar**, **War**, or **PythonZip**.', example='http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required if you set **PackageType** to **FatJar**, **War**, or **PythonZip**.', example='1.0.1'),
  phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='The script that is run immediately after the container is started. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  programmingLanguage?: string(name='ProgrammingLanguage', description='The programming language. Valid values: **java**, **php**, **python**, and **shell**.', example='java'),
  python?: string(name='Python', description='The Python environment. Set the value to **PYTHON 3.9.15**.', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', description='The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box.', example='Flask==2.0'),
  refAppId?: string(name='RefAppId', description='The ID of the job that you reference.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  replicas?: int32(name='Replicas', description='The number of concurrent instances.

This parameter is required.', example='3'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-wz969ngg2e49q5i4****'),
  slice?: boolean(name='Slice', description='Specifies whether to enable job sharding.', example='true'),
  sliceEnvs?: string(name='SliceEnvs', description='The parameters of job sharding.', example='[0,1,2]'),
  slsConfigs?: string(name='SlsConfigs', description='The logging configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

The following table describes the parameters that are used in the preceding statements.

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the **SlsConfigs** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the **SlsConfigs** parameter empty in the request.

> A Log Service project that is automatically created by SAE when you create an application is deleted when the application is deleted. Therefore, when you create an application, you cannot select a Log Service project that is automatically created by SAE for log collection.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
  timeout?: long(name='Timeout', description='The timeout period. Unit: seconds.', example='3600'),
  timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to cancel this configuration, set this parameter to "" or "{}". The following variables are included in the configuration: Take note of the following rules:

*   **port**: the port number. The port number ranges from 1024 to 65535. Though the admin permissions are configured for the container, the root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not specify this parameter, the default port number 8080 is used.
*   **contextPath**: the path. Default value: /. This value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312.************ If you do not specify this parameter, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: specifies whether to use the encoding scheme specified in the request body for URI query parameters. Default value: true.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  triggerConfig?: string(name='TriggerConfig'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch to which the elastic network interface (ENI) of the application instance is connected. The vSwitch must be located in the VPC specified by the VpcId parameter. The SAE namespace is bound with this vSwitch. The default value is the ID of the vSwitch that is bound to the namespace.', example='vsw-bp12mw1f8k3jgygk9****'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) that corresponds to the SAE namespace. In SAE, once correspondence is configured between a namespace and a VPC, the namespace cannot correspond to other VPCs. When the SAE application is created within the namespace, the application is bound with the VPC. Multiple namespaces can correspond to the same VPC. The default value is the ID of the VPC that is bound to the namespace.', example='vpc-bp1aevy8sofi8mh1q****'),
  warStartOptions?: string(name='WarStartOptions', description='The startup command of the WAR package. For information about how to configure the startup command, see [Configure startup commands](https://help.aliyun.com/document_detail/96677.html).', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. Valid values:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='apache-tomcat-7.0.91'),
  workload?: string(name='Workload', description='Set the value to `job`.

This parameter is required.', example='job'),
}

model CreateJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. It can be used to query the task status.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3***'),
  success?: boolean(name='Success', description='Indicates whether the application deployment is successful. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622246421415014e****'),
}

model CreateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateJobResponseBody(name='body'),
}

/**
 * @summary Create a job template.
 *
 * @param request CreateJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateJobResponse
 */
async function createJobWithOptions(request: CreateJobRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.acrAssumeRoleArn)) {
    query['AcrAssumeRoleArn'] = request.acrAssumeRoleArn;
  }
  if (!$isNull(request.appDescription)) {
    query['AppDescription'] = request.appDescription;
  }
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.autoConfig)) {
    query['AutoConfig'] = request.autoConfig;
  }
  if (!$isNull(request.backoffLimit)) {
    query['BackoffLimit'] = request.backoffLimit;
  }
  if (!$isNull(request.command)) {
    query['Command'] = request.command;
  }
  if (!$isNull(request.commandArgs)) {
    query['CommandArgs'] = request.commandArgs;
  }
  if (!$isNull(request.concurrencyPolicy)) {
    query['ConcurrencyPolicy'] = request.concurrencyPolicy;
  }
  if (!$isNull(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!$isNull(request.customHostAlias)) {
    query['CustomHostAlias'] = request.customHostAlias;
  }
  if (!$isNull(request.edasContainerVersion)) {
    query['EdasContainerVersion'] = request.edasContainerVersion;
  }
  if (!$isNull(request.envs)) {
    query['Envs'] = request.envs;
  }
  if (!$isNull(request.imagePullSecrets)) {
    query['ImagePullSecrets'] = request.imagePullSecrets;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.jarStartArgs)) {
    query['JarStartArgs'] = request.jarStartArgs;
  }
  if (!$isNull(request.jarStartOptions)) {
    query['JarStartOptions'] = request.jarStartOptions;
  }
  if (!$isNull(request.jdk)) {
    query['Jdk'] = request.jdk;
  }
  if (!$isNull(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!$isNull(request.mountDesc)) {
    query['MountDesc'] = request.mountDesc;
  }
  if (!$isNull(request.mountHost)) {
    query['MountHost'] = request.mountHost;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.nasId)) {
    query['NasId'] = request.nasId;
  }
  if (!$isNull(request.packageType)) {
    query['PackageType'] = request.packageType;
  }
  if (!$isNull(request.packageUrl)) {
    query['PackageUrl'] = request.packageUrl;
  }
  if (!$isNull(request.packageVersion)) {
    query['PackageVersion'] = request.packageVersion;
  }
  if (!$isNull(request.phpConfigLocation)) {
    query['PhpConfigLocation'] = request.phpConfigLocation;
  }
  if (!$isNull(request.postStart)) {
    query['PostStart'] = request.postStart;
  }
  if (!$isNull(request.preStop)) {
    query['PreStop'] = request.preStop;
  }
  if (!$isNull(request.programmingLanguage)) {
    query['ProgrammingLanguage'] = request.programmingLanguage;
  }
  if (!$isNull(request.python)) {
    query['Python'] = request.python;
  }
  if (!$isNull(request.pythonModules)) {
    query['PythonModules'] = request.pythonModules;
  }
  if (!$isNull(request.refAppId)) {
    query['RefAppId'] = request.refAppId;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.slice)) {
    query['Slice'] = request.slice;
  }
  if (!$isNull(request.sliceEnvs)) {
    query['SliceEnvs'] = request.sliceEnvs;
  }
  if (!$isNull(request.slsConfigs)) {
    query['SlsConfigs'] = request.slsConfigs;
  }
  if (!$isNull(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!$isNull(request.timeout)) {
    query['Timeout'] = request.timeout;
  }
  if (!$isNull(request.timezone)) {
    query['Timezone'] = request.timezone;
  }
  if (!$isNull(request.tomcatConfig)) {
    query['TomcatConfig'] = request.tomcatConfig;
  }
  if (!$isNull(request.triggerConfig)) {
    query['TriggerConfig'] = request.triggerConfig;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.warStartOptions)) {
    query['WarStartOptions'] = request.warStartOptions;
  }
  if (!$isNull(request.webContainer)) {
    query['WebContainer'] = request.webContainer;
  }
  if (!$isNull(request.workload)) {
    query['Workload'] = request.workload;
  }

  var body : map[string]any = {};
  if (!$isNull(request.acrInstanceId)) {
    body['AcrInstanceId'] = request.acrInstanceId;
  }
  if (!$isNull(request.configMapMountDesc)) {
    body['ConfigMapMountDesc'] = request.configMapMountDesc;
  }
  if (!$isNull(request.enableImageAccl)) {
    body['EnableImageAccl'] = request.enableImageAccl;
  }
  if (!$isNull(request.ossAkId)) {
    body['OssAkId'] = request.ossAkId;
  }
  if (!$isNull(request.ossAkSecret)) {
    body['OssAkSecret'] = request.ossAkSecret;
  }
  if (!$isNull(request.ossMountDescs)) {
    body['OssMountDescs'] = request.ossMountDescs;
  }
  if (!$isNull(request.phpConfig)) {
    body['PhpConfig'] = request.phpConfig;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/createJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create a job template.
 *
 * @param request CreateJobRequest
 * @return CreateJobResponse
 */
async function createJob(request: CreateJobRequest): CreateJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createJobWithOptions(request, headers, runtime);
}

model CreateNamespaceRequest {
  enableMicroRegistration?: boolean(name='EnableMicroRegistration', description='Indicates whether to enable SAE built-in registry:

*   **true**
*   **false**

Default value: true. If you do not use the built-in registry, you can set this parameter to false to accelerate the creation of a namespace.', example='true'),
  nameSpaceShortId?: string(name='NameSpaceShortId', description='The trace ID that is used to query the details of the request.', example='test'),
  namespaceDescription?: string(name='NamespaceDescription', description='The message returned for the operation.', example='desc'),
  namespaceId?: string(name='NamespaceId', description='The data returned.', example='cn-beijing:test'),
  namespaceName?: string(name='NamespaceName', description='The ID of the request.

This parameter is required.', example='name'),
}

model CreateNamespaceResponseBody = {
  code?: string(name='Code', description='bucketPath', example='200'),
  data?: {
    enableMicroRegistration?: boolean(name='EnableMicroRegistration', description='Indicates whether the SAE built-in registry is enabled:

*   **true**
*   **false**', example='true'),
    nameSpaceShortId?: string(name='NameSpaceShortId', description='Indicates whether the namespace was created. Valid values:

*   **true**: The instance was created.
*   **false**: The call failed to be created.', example='test'),
    namespaceDescription?: string(name='NamespaceDescription', description='The short ID of the namespace.', example='desc'),
    namespaceId?: string(name='NamespaceId', description='The error code returned. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='cn-beijing:test'),
    namespaceName?: string(name='NamespaceName', description='Null', example='name'),
    regionId?: string(name='RegionId', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='cn-beijing'),
  }(name='Data', description='The information about a namespace.'),
  errorCode?: string(name='ErrorCode', description='http://sae_pop_pre/#vpc', example='bucketName'),
  message?: string(name='Message', description='The ID of the namespace.', example='success'),
  requestId?: string(name='RequestId', description='The description of the custom namespace.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='mountDir', example='true'),
  traceId?: string(name='TraceId', description='The name of the namespace.', example='0a981dd515966966104121683d****'),
}

model CreateNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNamespaceResponseBody(name='body'),
}

/**
 * @summary Create a namespace.
 *
 * @param request CreateNamespaceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNamespaceResponse
 */
async function createNamespaceWithOptions(request: CreateNamespaceRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateNamespaceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.enableMicroRegistration)) {
    query['EnableMicroRegistration'] = request.enableMicroRegistration;
  }
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceDescription)) {
    query['NamespaceDescription'] = request.namespaceDescription;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.namespaceName)) {
    query['NamespaceName'] = request.namespaceName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateNamespace',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/namespace`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create a namespace.
 *
 * @param request CreateNamespaceRequest
 * @return CreateNamespaceResponse
 */
async function createNamespace(request: CreateNamespaceRequest): CreateNamespaceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createNamespaceWithOptions(request, headers, runtime);
}

model CreateSecretRequest {
  namespaceId?: string(name='NamespaceId', description='This parameter is required.', example='cn-beijing:test'),
  secretData?: {
    secretData?: string(name='SecretData', description='This parameter is required.'),
  }(name='SecretData', description='This parameter is required.'),
  secretName?: string(name='SecretName', description='This parameter is required.', example='registry-auth-acree'),
  secretType?: string(name='SecretType', description='This parameter is required.', example='kubernetes.io/dockerconfigjson'),
}

model CreateSecretShrinkRequest {
  namespaceId?: string(name='NamespaceId', description='This parameter is required.', example='cn-beijing:test'),
  secretDataShrink?: string(name='SecretData', description='This parameter is required.'),
  secretName?: string(name='SecretName', description='This parameter is required.', example='registry-auth-acree'),
  secretType?: string(name='SecretType', description='This parameter is required.', example='kubernetes.io/dockerconfigjson'),
}

model CreateSecretResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    secretId?: long(name='SecretId', example='16'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model CreateSecretResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSecretResponseBody(name='body'),
}

/**
 * @summary Null
 *
 * @param tmpReq CreateSecretRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSecretResponse
 */
async function createSecretWithOptions(tmpReq: CreateSecretRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateSecretResponse {
  tmpReq.validate();
  var request = new CreateSecretShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.secretData)) {
    request.secretDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.secretData, 'SecretData', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.secretDataShrink)) {
    query['SecretData'] = request.secretDataShrink;
  }
  if (!$isNull(request.secretName)) {
    query['SecretName'] = request.secretName;
  }
  if (!$isNull(request.secretType)) {
    query['SecretType'] = request.secretType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSecret',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/secret/secret`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Null
 *
 * @param request CreateSecretRequest
 * @return CreateSecretResponse
 */
async function createSecret(request: CreateSecretRequest): CreateSecretResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createSecretWithOptions(request, headers, runtime);
}

model CreateWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
  body?: CreateWebApplicationInput(name='body', description='The information about the application.

This parameter is required.'),
}

model CreateWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Create a web application
 *
 * @description Call the CreateWebApplication operation to create a web application.
 *
 * @param request CreateWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWebApplicationResponse
 */
async function createWebApplicationWithOptions(request: CreateWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create a web application
 *
 * @description Call the CreateWebApplication operation to create a web application.
 *
 * @param request CreateWebApplicationRequest
 * @return CreateWebApplicationResponse
 */
async function createWebApplication(request: CreateWebApplicationRequest): CreateWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createWebApplicationWithOptions(request, headers, runtime);
}

model CreateWebCustomDomainRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
  body?: CreateWebCustomDomainInput(name='body', description='The information about custom domain name.

This parameter is required.'),
}

model CreateWebCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebCustomDomainBody  
}

/**
 * @summary Create a custom domain name for the web application.
 *
 * @description Create a custom domain name for the web application.
 *
 * @param request CreateWebCustomDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWebCustomDomainResponse
 */
async function createWebCustomDomainWithOptions(request: CreateWebCustomDomainRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateWebCustomDomainResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateWebCustomDomain',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/custom-domains`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create a custom domain name for the web application.
 *
 * @description Create a custom domain name for the web application.
 *
 * @param request CreateWebCustomDomainRequest
 * @return CreateWebCustomDomainResponse
 */
async function createWebCustomDomain(request: CreateWebCustomDomainRequest): CreateWebCustomDomainResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createWebCustomDomainWithOptions(request, headers, runtime);
}

model DeleteApplicationRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
}

model DeleteApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. The ID can be used to query the status of the change task.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The result returned.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** section of this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   If the request was successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application is deleted. Valid values:

*   **true**: The applications were deleted
*   **false**: The applications failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DeleteApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApplicationResponseBody(name='body'),
}

/**
 * @summary Deletes an application.
 *
 * @param request DeleteApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApplicationResponse
 */
async function deleteApplicationWithOptions(request: DeleteApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/deleteApplication`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application.
 *
 * @param request DeleteApplicationRequest
 * @return DeleteApplicationResponse
 */
async function deleteApplication(request: DeleteApplicationRequest): DeleteApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteApplicationWithOptions(request, headers, runtime);
}

model DeleteApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='The ID of the request.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  scalingRuleName?: string(name='ScalingRuleName', description='The ID of the trace. The ID is used to query the details of a request.

This parameter is required.', example='timer-0800-2100'),
}

model DeleteApplicationScalingRuleResponseBody = {
  code?: string(name='Code'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model DeleteApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @summary 7171a6ca-d1cd-4928-8642-7d5cfe69\\*\\*\\*\\*
 *
 * @param request DeleteApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteApplicationScalingRuleResponse
 */
async function deleteApplicationScalingRuleWithOptions(request: DeleteApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/applicationScalingRule`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 7171a6ca-d1cd-4928-8642-7d5cfe69\\*\\*\\*\\*
 *
 * @param request DeleteApplicationScalingRuleRequest
 * @return DeleteApplicationScalingRuleResponse
 */
async function deleteApplicationScalingRule(request: DeleteApplicationScalingRuleRequest): DeleteApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteApplicationScalingRuleWithOptions(request, headers, runtime);
}

model DeleteConfigMapRequest {
  configMapId?: long(name='ConfigMapId', description='The ID of the ConfigMap that you want to delete. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID of a ConfigMap.

This parameter is required.', example='1'),
}

model DeleteConfigMapResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    configMapId?: long(name='ConfigMapId', description='The ID of the deleted ConfigMap.', example='1'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the ConfigMap was deleted. Valid values:

*   **true**: The ConfigMap was deleted.
*   **false**: The ConfigMap failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteConfigMapResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteConfigMapResponseBody(name='body'),
}

/**
 * @summary Deletes a ConfigMap.
 *
 * @param request DeleteConfigMapRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteConfigMapResponse
 */
async function deleteConfigMapWithOptions(request: DeleteConfigMapRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteConfigMapResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.configMapId)) {
    query['ConfigMapId'] = request.configMapId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteConfigMap',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/configmap/configMap`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a ConfigMap.
 *
 * @param request DeleteConfigMapRequest
 * @return DeleteConfigMapResponse
 */
async function deleteConfigMap(request: DeleteConfigMapRequest): DeleteConfigMapResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteConfigMapWithOptions(request, headers, runtime);
}

model DeleteGreyTagRouteRequest {
  greyTagRouteId?: long(name='GreyTagRouteId', description='The rule ID.

This parameter is required.', example='1'),
}

model DeleteGreyTagRouteResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule. The ID is globally unique.', example='16'),
  }(name='Data', description='The information about the canary release rule.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='9D29CBD0-45D3-410B-9826-52F86F90****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteGreyTagRouteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGreyTagRouteResponseBody(name='body'),
}

/**
 * @summary Deletes a canary release rule based on the specified rule ID.
 *
 * @param request DeleteGreyTagRouteRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGreyTagRouteResponse
 */
async function deleteGreyTagRouteWithOptions(request: DeleteGreyTagRouteRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteGreyTagRouteResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.greyTagRouteId)) {
    query['GreyTagRouteId'] = request.greyTagRouteId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteGreyTagRoute',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/tagroute/greyTagRoute`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a canary release rule based on the specified rule ID.
 *
 * @param request DeleteGreyTagRouteRequest
 * @return DeleteGreyTagRouteResponse
 */
async function deleteGreyTagRoute(request: DeleteGreyTagRouteRequest): DeleteGreyTagRouteResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteGreyTagRouteWithOptions(request, headers, runtime);
}

model DeleteHistoryJobRequest {
  appId?: string(name='AppId', description='The ID of the job template to which the job that you want to delete belongs.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  jobId?: string(name='JobId', description='The ID of the job.

This parameter is required.', example='manual-3db7a8fa-5d40-4edc-92e4-49d50eab****'),
}

model DeleteHistoryJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: string(name='Data', description='The result returned.', example='{msg: "", code: 200, success: true}'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned information. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the job was deleted. Valid values:

*   **true**: The job was deleted.
*   **false**: The job failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteHistoryJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHistoryJobResponseBody(name='body'),
}

/**
 * @summary Delete a job.
 *
 * @param request DeleteHistoryJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHistoryJobResponse
 */
async function deleteHistoryJobWithOptions(request: DeleteHistoryJobRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteHistoryJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteHistoryJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/deleteHistoryJob`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete a job.
 *
 * @param request DeleteHistoryJobRequest
 * @return DeleteHistoryJobResponse
 */
async function deleteHistoryJob(request: DeleteHistoryJobRequest): DeleteHistoryJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteHistoryJobWithOptions(request, headers, runtime);
}

model DeleteIngressRequest {
  ingressId?: long(name='IngressId', description='The ID of the routing rule that you want to delete. You can call the [ListIngresses](https://help.aliyun.com/document_detail/153934.html) operation to obtain the ID of a routing rule.

This parameter is required.', example='87'),
}

model DeleteIngressResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    ingressId?: long(name='IngressId', description='The ID of the deleted routing rule.', example='87'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the routing rule was deleted. Valid values:

*   **true**: The routing rule was deleted.
*   **false**: The routing rule failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteIngressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIngressResponseBody(name='body'),
}

/**
 * @summary Deletes a routing rule.
 *
 * @param request DeleteIngressRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIngressResponse
 */
async function deleteIngressWithOptions(request: DeleteIngressRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteIngressResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.ingressId)) {
    query['IngressId'] = request.ingressId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteIngress',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/ingress/Ingress`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a routing rule.
 *
 * @param request DeleteIngressRequest
 * @return DeleteIngressResponse
 */
async function deleteIngress(request: DeleteIngressRequest): DeleteIngressResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteIngressWithOptions(request, headers, runtime);
}

model DeleteJobRequest {
  appId?: string(name='AppId', description='The ID of the job template that you want to delete.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
}

model DeleteJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: string(name='Data', description='The result returned.', example='{msg: "", code: 200, success: true}'),
  errorCode?: string(name='ErrorCode', description='The error code that is returned. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request is successful.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application is deleted. Valid values:

*   **true**: The namespaces were obtained.
*   **false**: no', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteJobResponseBody(name='body'),
}

/**
 * @summary Delete a job template.
 *
 * @param request DeleteJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteJobResponse
 */
async function deleteJobWithOptions(request: DeleteJobRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/deleteJob`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete a job template.
 *
 * @param request DeleteJobRequest
 * @return DeleteJobResponse
 */
async function deleteJob(request: DeleteJobRequest): DeleteJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteJobWithOptions(request, headers, runtime);
}

model DeleteNamespaceRequest {
  nameSpaceShortId?: string(name='NameSpaceShortId', example='test'),
  namespaceId?: string(name='NamespaceId', description='cn-beijing:test', example='cn-beijing:test'),
}

model DeleteNamespaceResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the namespace was deleted. Valid values:

*   **true**: indicates that the namespace was deleted.
*   **false**: indicates that the namespace could not be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It can be used to query the details of a request.', example='0a981dd515966966104121683d****'),
}

model DeleteNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNamespaceResponseBody(name='body'),
}

/**
 * @summary Deletes a namespace.
 *
 * @param request DeleteNamespaceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNamespaceResponse
 */
async function deleteNamespaceWithOptions(request: DeleteNamespaceRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteNamespaceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteNamespace',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/namespace`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a namespace.
 *
 * @param request DeleteNamespaceRequest
 * @return DeleteNamespaceResponse
 */
async function deleteNamespace(request: DeleteNamespaceRequest): DeleteNamespaceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteNamespaceWithOptions(request, headers, runtime);
}

model DeleteSecretRequest {
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace in which the Secret resides. By default, the namespace ID is the same as the region ID.

This parameter is required.', example='cn-beijing:test'),
  secretId?: long(name='SecretId', description='The ID of the Secret to be deleted. You can call the [ListSecrets](https://help.aliyun.com/document_detail/466929.html) operation to view the Secret IDs.

This parameter is required.', example='16'),
}

model DeleteSecretResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    secretId?: long(name='SecretId', description='The ID of the deleted Secret.', example='16'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Valid values:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the Secret is successfully deleted. Valid values:

*   **true**: The instance was deleted.
*   **false**: The instance failed to be deleted.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DeleteSecretResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecretResponseBody(name='body'),
}

/**
 * @summary Deletes a Secret.
 *
 * @param request DeleteSecretRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecretResponse
 */
async function deleteSecretWithOptions(request: DeleteSecretRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteSecretResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSecret',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/secret/secret`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a Secret.
 *
 * @param request DeleteSecretRequest
 * @return DeleteSecretResponse
 */
async function deleteSecret(request: DeleteSecretRequest): DeleteSecretResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSecretWithOptions(request, headers, runtime);
}

model DeleteWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
}

model DeleteWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Delete a web application.
 *
 * @description Call the DeleteWebApplication operation to delete a web application.
 *
 * @param request DeleteWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWebApplicationResponse
 */
async function deleteWebApplicationWithOptions(ApplicationId: string, request: DeleteWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications/${$URL.percentEncode(ApplicationId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete a web application.
 *
 * @description Call the DeleteWebApplication operation to delete a web application.
 *
 * @param request DeleteWebApplicationRequest
 * @return DeleteWebApplicationResponse
 */
async function deleteWebApplication(ApplicationId: string, request: DeleteWebApplicationRequest): DeleteWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWebApplicationWithOptions(ApplicationId, request, headers, runtime);
}

model DeleteWebApplicationRevisionRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
}

model DeleteWebApplicationRevisionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationRevisionBody  
}

/**
 * @summary Delete a web application version.
 *
 * @description Delete a web application version.
 *
 * @param request DeleteWebApplicationRevisionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWebApplicationRevisionResponse
 */
async function deleteWebApplicationRevisionWithOptions(ApplicationId: string, RevisionId: string, request: DeleteWebApplicationRevisionRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteWebApplicationRevisionResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteWebApplicationRevision',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-revisions/${$URL.percentEncode(ApplicationId)}/revisions/${$URL.percentEncode(RevisionId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete a web application version.
 *
 * @description Delete a web application version.
 *
 * @param request DeleteWebApplicationRevisionRequest
 * @return DeleteWebApplicationRevisionResponse
 */
async function deleteWebApplicationRevision(ApplicationId: string, RevisionId: string, request: DeleteWebApplicationRevisionRequest): DeleteWebApplicationRevisionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWebApplicationRevisionWithOptions(ApplicationId, RevisionId, request, headers, runtime);
}

model DeleteWebCustomDomainRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
}

model DeleteWebCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebCustomDomainBody  
}

/**
 * @summary Delete a custom domain name.
 *
 * @description Delete a custom domain name.
 *
 * @param request DeleteWebCustomDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWebCustomDomainResponse
 */
async function deleteWebCustomDomainWithOptions(DomainName: string, request: DeleteWebCustomDomainRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteWebCustomDomainResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteWebCustomDomain',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/custom-domains/${$URL.percentEncode(DomainName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete a custom domain name.
 *
 * @description Delete a custom domain name.
 *
 * @param request DeleteWebCustomDomainRequest
 * @return DeleteWebCustomDomainResponse
 */
async function deleteWebCustomDomain(DomainName: string, request: DeleteWebCustomDomainRequest): DeleteWebCustomDomainResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteWebCustomDomainWithOptions(DomainName, request, headers, runtime);
}

model DeployApplicationRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) required for a RAM role to obtain images across accounts. For more information, see [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='The ID of Container Registry Enterprise Edition instance N. This parameter is required when the **ImageUrl** parameter is set to the URL of an image in an ACR Enterprise Edition instance.', example='cri-xxxxxx'),
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  associateEip?: boolean(name='AssociateEip', description='Specifies whether to associate an EIP with the node pool. Take note of the following rules:

*   **true**: The EIP is associated with the application instance.
*   **false**: The EIP is not associated with the application instance.', example='true'),
  autoEnableApplicationScalingRule?: boolean(name='AutoEnableApplicationScalingRule', description='Specifies whether to automatically enable an auto scaling policy for the application. Take note of the following rules:

*   **true**: turns on Logon-free Sharing
*   **false**: turns off Logon-free Sharing', example='true'),
  batchWaitTime?: int32(name='BatchWaitTime', description='The interval between batches during a batch release. Unit: minutes.', example='10'),
  changeOrderDesc?: string(name='ChangeOrderDesc', description='The description of the change order.', example='Start the application'),
  command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Sample statements:

    command:
          - echo
          - abc
          - >
          - file0

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
  commandArgs?: string(name='CommandArgs', description='The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the **Command** parameter. You can specify the name in one of the following formats:

`["a","b"]`

In the preceding example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. This parameter is optional.', example='["a","b"]'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='The description of the **ConfigMap** instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following table describes the parameters that are used in the preceding statements.

*   **congfigMapId**: the ID of the ConfigMap instance. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID.
*   **key**: the key.

> You can use `sae-sys-configmap-all` to mount all keys.

*   **mountPath**: the mount path in the container.', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  cpu?: int32(name='Cpu', example='1000'),
  customHostAlias?: string(name='CustomHostAlias', description='The custom mappings between hostnames and IP addresses in the container. Take note of the following rules:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  customImageNetworkType?: string(name='CustomImageNetworkType', example='internet'),
  deploy?: string(name='Deploy', description='This parameter takes effect only for applications that are in the Stopped state. If you call the **DeployApplication** operation to manage a running application, the application is immediately redeployed.

*   **true** (default): specifies that the system immediately deploys the application, enables new configurations, and pulls application instances.
*   **false**: specifies that the system only enables the new configurations.', example='true'),
  dotnet?: string(name='Dotnet', example='.NET 3.1'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
  enableAhas?: string(name='EnableAhas', description='Indicates whether access to Application High Availability Service (AHAS) is enabled. Take note of the following rules:

*   **true**: Access to AHAS is enabled.
*   **false**: Access to AHAS is disabled.', example='false'),
  enableCpuBurst?: boolean(name='EnableCpuBurst', example='true'),
  enableGreyTagRoute?: boolean(name='EnableGreyTagRoute', description='Indicates whether canary release rules are enabled. Canary release rules apply only to applications in Spring Cloud and Dubbo frameworks. Take note of the following rules:

*   **true**: The canary release rules are enabled.
*   **false**: The canary release rules are disabled.', example='false'),
  enableNewArms?: boolean(name='EnableNewArms', example='true'),
  enableSidecarResourceIsolated?: boolean(name='EnableSidecarResourceIsolated', example='true'),
  envs?: string(name='Envs', description='The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see [CreateConfigMap](https://help.aliyun.com/document_detail/176914.html). Take note of the following rules:

*   Customize

    *   **name**: the name of the environment variable.
    *   **value**: the value of the environment variable.

*   Reference ConfigMap

    *   **name**: the name of the environment variable. You can reference one or all keys. If you want to reference all keys, specify `sae-sys-configmap-all-<ConfigMap name>`. Example: `sae-sys-configmap-all-test1`.
    *   **valueFrom**: the reference of the environment variable. Set the value to `configMapRef`.
    *   **configMapId**: the ConfigMap ID.
    *   **key**: the key. If you want to reference all keys, do not configure this parameter.', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', description='The ID of the corresponding Secret.', example='10'),
  imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if the **PackageType** parameter is set to **Image**.', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  initContainersConfig?: [
    InitContainerConfig
  ](name='InitContainersConfig'),
  jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Xms4G -Xmx4G'),
  jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='custom-option'),
  jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
  kafkaConfigs?: string(name='KafkaConfigs', description='The logging configurations of Message Queue for Apache Kafka. Take note of the following rules:

*   **kafkaEndpoint**: the endpoint of the Message Queue for Apache Kafka API.
*   **kafkaInstanceId**: the ID of the Message Queue for Apache Kafka instance.
*   **kafkaConfigs**: One or more logging configurations of Message Queue for Apache Kafka. For information about sample values and parameters, see the request parameter **KafkaLogfileConfig** in this topic.', example='{"kafkaEndpoint":"10.0.X.XXX:XXXX,10.0.X.XXX:XXXX,10.0.X.XXX:XXXX\\\\","kafkaInstanceId":"alikafka_pre-cn-7pp2l8kr****","kafkaConfigs":[{"logType":"file_log","logDir":"/tmp/a.log","kafkaTopic":"test2"},{"logType":"stdout","logDir":"","kafkaTopic":"test"}]}'),
  liveness?: string(name='Liveness', description='The details of the availability check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. You can use one of the following methods to perform the health check:

*   Example of **exec**: `{"exec":{"command":["sh","-c","cat/home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}`
*   Sample code of the **httpGet** method: `{"httpGet":{"path":"/","port":18091,"scheme":"HTTP","isContainKeyWord":true,"keyWord":"SAE"},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`
*   Sample code of the **tcpSocket** method: `{"tcpSocket":{"port":18091},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`

> You can use only one method to perform the health check.

The following table describes the parameters that are used in the preceding statements.

*   **exec.command**: the health check command.
*   **httpGet.path**: the request path.
*   **httpGet.scheme**: the protocol that is used to perform the health check. Valid values: **HTTP** and **HTTPS**.
*   **httpGet.isContainKeyWord**: indicates whether the response contains keywords. Valid values: **true** and **false**. If this field is not returned, the advanced settings are not used.
*   **httpGet.keyWord**: the custom keyword. This parameter is available only if the **isContainKeyWord** field is returned.
*   **tcpSocket.port**: the port that is used to check the status of TCP connections.
*   **initialDelaySeconds**: the delay of the health check. Default value: 10. Unit: seconds.
*   **periodSeconds**: the interval at which health checks are performed. Default value: 30. Unit: seconds.
*   **timeoutSeconds**: the timeout period of the health check. Default value: 1. Unit: seconds. If you set this parameter to 0 or leave this parameter empty, the timeout period is automatically set to 1 second.', example='{"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11}'),
  memory?: int32(name='Memory', example='1024'),
  microRegistration?: string(name='MicroRegistration', description='The Nacos registry. Valid values:

*   **0**: SAE built-in Nacos registry
*   **1**: self-managed Nacos registry
*   **2** : MSE Nacos registry', example='"0"'),
  microRegistrationConfig?: string(name='MicroRegistrationConfig', example='{\\\\"instanceId\\\\":\\\\"mse-cn-zvp2bh6h70r\\\\",\\\\"namespace\\\\":\\\\"4c0aa74f-57cb-423c-b6af-5d9f2d0e3dbd\\\\"}'),
  microserviceEngineConfig?: string(name='MicroserviceEngineConfig'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. Default value: -1.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

> When both **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of **MinReadyInstanceRatio**** takes precedence. For example, if **MinReadyInstances** is set to **5, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Special values:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
  mountDesc?: string(name='MountDesc', description='The configurations for mounting the NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **MountDesc** parameter in the requests. If you want to unmount the NAS file system, you must set the **MountDesc** values in the subsequent requests to an empty string ("").', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the **MountHost** parameter empty in the request.', example='10d3b4bc9****.com'),
  nasConfigs?: string(name='NasConfigs', description='The configurations of mounting the NAS file system. Take note of the following rules:

*   **mountPath**: the mount path of the container.
*   **readOnly**: If you set the value to **false**, the application has the read and write permissions.
*   **nasId**: the ID of the NAS file system.
*   **mountDomain**: the domain name of the mount target. For more information, see [DescribeMountTargets](https://help.aliyun.com/document_detail/62626.html).
*   **nasPath**: the directory in the NAS file system.', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
  nasId?: string(name='NasId', description='The ID of the File Storage NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **NasId** parameter in the requests. If you want to unmount the NAS file system, you must set the **NasId** values in the subsequent requests to an empty string ("").', example='10d3b4****'),
  newSaeVersion?: string(name='NewSaeVersion'),
  oidcRoleName?: string(name='OidcRoleName', description='The name of the RAM role used to authenticate the user identity.

>  You need to create an OpenID Connect (OIDC) identity provider (IdP) and an identity provider (IdP) for role-based single sign-on (SSO) in advance. For more information, see [Creates an OpenID Connect (OIDC) identity provider (IdP)](https://help.aliyun.com/document_detail/2331022.html) and [Creates an identity provider (IdP) for role-based single sign-on (SSO)](https://help.aliyun.com/document_detail/2331016.html).', example='sae-test'),
  ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS buckets.', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='Information of the Object Storage Service (OSS) bucket mounted to the application. The following table describes the parameters that are used in the preceding statements.

*   **bucketName**: the name of the OSS bucket.

*   **bucketPath**: the directory or object in OSS. If the specified directory or object does not exist, an error is returned.

*   **mountPath**: the directory of the container in SAE. If the path already exists, the newly specified path overwrites the previous one. If the path does not exist, it is created.

*   **readOnly**: specifies whether to only allow the container path to read data from the OSS directory. Valid values:

    *   **true**: The container path only has read permission on the OSS directory.
    *   **false**: The application has read and write permissions.', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageType?: string(name='PackageType', example='FatJar'),
  packageUrl?: string(name='PackageUrl', description='The address of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PythonZip**.', example='http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PythonZip**.', example='1.0.1'),
  php?: string(name='Php', example='PHP-FPM 7.0'),
  phpArmsConfigLocation?: string(name='PhpArmsConfigLocation', description='The path on which the PHP configuration file for application monitoring is mounted. Make sure that the PHP server loads the configuration file. SAE automatically generates the corresponding configuration file. No manual operations are required.', example='/usr/local/etc/php/conf.d/arms.ini'),
  phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='The script that is run immediately after the container is started. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  pvtzDiscoverySvc?: string(name='PvtzDiscoverySvc', description='The configurations of Kubernetes Service-based service registration and discovery. Take note of the following rules:

*   **serviceName**: the name of the Alibaba Cloud service. Format: `<Custom content>-<Namespace ID>`. `-<Namespace ID>` is automatically specified based on the namespace in which an application resides and cannot be changed. For example, if you select the default namespace in the China (Beijing) region, `-cn-beijing-default` is automatically specified.
*   **namespaceId**: the namespace ID.
*   **portAndProtocol**: the port number and protocol. Valid values of the port number: 1 to 65535. Valid values of the protocol: **TCP** and **UDP**.
*   **enable**: enables the Kubernetes Service-based registration and discovery feature.', example='{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true}'),
  python?: string(name='Python', description='The Python environment. Set the value to **PYTHON 3.9.15**.', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', description='The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box.', example='Flask==2.0'),
  readiness?: string(name='Readiness', description='The details of the health check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. Containers that fail health checks cannot receive traffic from Server Load Balancer (SLB) instances. You can use the **exec**, **httpGet**, or **tcpSocket** method to perform health checks. For more information, see the description of the **Liveness** parameter.

> You can use only one method to perform the health check.', example='{"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12}'),
  replicas?: int32(name='Replicas', example='1'),
  secretMountDesc?: string(name='SecretMountDesc', example='[{“secretId":10,”key":"test","mountPath":"/tmp"}]'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-wz969ngg2e49q5i4****'),
  serviceTags?: string(name='ServiceTags', example='{\\\\"alicloud.service.tag\\\\":\\\\"g1\\\\"}'),
  sidecarContainersConfig?: [
    SidecarContainerConfig
  ](name='SidecarContainersConfig', description='The configuration of the container.'),
  slsConfigs?: string(name='SlsConfigs', description='The logging configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

The following table describes the parameters that are used in the preceding statements.

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the **SlsConfigs** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the **SlsConfigs** parameter empty in the request.

> A Log Service project that is automatically created by SAE when you create an application is deleted when the application is deleted. Therefore, when you create an application, you cannot select a Log Service project that is automatically created by SAE for log collection.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  swimlanePvtzDiscoverySvc?: string(name='SwimlanePvtzDiscoverySvc'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
  timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to cancel this configuration, set this parameter to "" or "{}". The following variables are included in the configuration: Take note of the following rules:

*   **port**: the port number. The port number ranges from 1024 to 65535. Though the admin permissions are configured for the container, the root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not specify this parameter, the default port number 8080 is used.
*   **contextPath**: the path. Default value: /. This value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312.************ If you do not specify this parameter, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: specifies whether to use the encoding scheme specified in the request body for URI query parameters. Default value: true.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  updateStrategy?: string(name='UpdateStrategy', description='The deployment policy. If the minimum number of available instances is 1, the value of the **UpdateStrategy** parameter is an empty string (""). If the minimum number of available instances is greater than 1, the following strategies can be configured:

*   The application is deployed on an instance. The remaining instances are automatically classified into two release batches whose interval is set to 1. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}`.
*   The application is deployed on an instance. The remaining instances are manually classified into two release batches. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}`.
*   All instances are automatically classified into two release batches. The application is deployed on the instances of the two batches in parallel. In this case, the parameter is set to `{"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}`

The following table describes the parameters that are used in the preceding statements.

*   **type**: the type of the release policy. Valid values: **GrayBatchUpdate** and **BatchUpdate**.

*   **batchUpdate**: the phased release policy.

    *   **batch**: the number of release batches.
    *   **releaseType**: the processing method for the batches. Valid values: **auto** and **manual**.
    *   **batchWaitTime**: the interval between release batches. Unit: seconds.

*   **grayUpdate**: the number of release batches in the phased release after a canary release. This parameter is returned only if the **type** parameter is set to **GrayBatchUpdate**.', example='{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}'),
  vSwitchId?: string(name='VSwitchId', example='vsw-bp12mw1f8k3jgygk9****'),
  warStartOptions?: string(name='WarStartOptions', description='The startup command of the WAR package. For information about how to configure the startup command, see [Configure startup commands](https://help.aliyun.com/document_detail/96677.html).', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. Valid values:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='apache-tomcat-7.0.91'),
}

model DeployApplicationShrinkRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) required for a RAM role to obtain images across accounts. For more information, see [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='The ID of Container Registry Enterprise Edition instance N. This parameter is required when the **ImageUrl** parameter is set to the URL of an image in an ACR Enterprise Edition instance.', example='cri-xxxxxx'),
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  associateEip?: boolean(name='AssociateEip', description='Specifies whether to associate an EIP with the node pool. Take note of the following rules:

*   **true**: The EIP is associated with the application instance.
*   **false**: The EIP is not associated with the application instance.', example='true'),
  autoEnableApplicationScalingRule?: boolean(name='AutoEnableApplicationScalingRule', description='Specifies whether to automatically enable an auto scaling policy for the application. Take note of the following rules:

*   **true**: turns on Logon-free Sharing
*   **false**: turns off Logon-free Sharing', example='true'),
  batchWaitTime?: int32(name='BatchWaitTime', description='The interval between batches during a batch release. Unit: minutes.', example='10'),
  changeOrderDesc?: string(name='ChangeOrderDesc', description='The description of the change order.', example='Start the application'),
  command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Sample statements:

    command:
          - echo
          - abc
          - >
          - file0

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
  commandArgs?: string(name='CommandArgs', description='The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the **Command** parameter. You can specify the name in one of the following formats:

`["a","b"]`

In the preceding example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. This parameter is optional.', example='["a","b"]'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='The description of the **ConfigMap** instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following table describes the parameters that are used in the preceding statements.

*   **congfigMapId**: the ID of the ConfigMap instance. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID.
*   **key**: the key.

> You can use `sae-sys-configmap-all` to mount all keys.

*   **mountPath**: the mount path in the container.', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  cpu?: int32(name='Cpu', example='1000'),
  customHostAlias?: string(name='CustomHostAlias', description='The custom mappings between hostnames and IP addresses in the container. Take note of the following rules:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  customImageNetworkType?: string(name='CustomImageNetworkType', example='internet'),
  deploy?: string(name='Deploy', description='This parameter takes effect only for applications that are in the Stopped state. If you call the **DeployApplication** operation to manage a running application, the application is immediately redeployed.

*   **true** (default): specifies that the system immediately deploys the application, enables new configurations, and pulls application instances.
*   **false**: specifies that the system only enables the new configurations.', example='true'),
  dotnet?: string(name='Dotnet', example='.NET 3.1'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
  enableAhas?: string(name='EnableAhas', description='Indicates whether access to Application High Availability Service (AHAS) is enabled. Take note of the following rules:

*   **true**: Access to AHAS is enabled.
*   **false**: Access to AHAS is disabled.', example='false'),
  enableCpuBurst?: boolean(name='EnableCpuBurst', example='true'),
  enableGreyTagRoute?: boolean(name='EnableGreyTagRoute', description='Indicates whether canary release rules are enabled. Canary release rules apply only to applications in Spring Cloud and Dubbo frameworks. Take note of the following rules:

*   **true**: The canary release rules are enabled.
*   **false**: The canary release rules are disabled.', example='false'),
  enableNewArms?: boolean(name='EnableNewArms', example='true'),
  enableSidecarResourceIsolated?: boolean(name='EnableSidecarResourceIsolated', example='true'),
  envs?: string(name='Envs', description='The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see [CreateConfigMap](https://help.aliyun.com/document_detail/176914.html). Take note of the following rules:

*   Customize

    *   **name**: the name of the environment variable.
    *   **value**: the value of the environment variable.

*   Reference ConfigMap

    *   **name**: the name of the environment variable. You can reference one or all keys. If you want to reference all keys, specify `sae-sys-configmap-all-<ConfigMap name>`. Example: `sae-sys-configmap-all-test1`.
    *   **valueFrom**: the reference of the environment variable. Set the value to `configMapRef`.
    *   **configMapId**: the ConfigMap ID.
    *   **key**: the key. If you want to reference all keys, do not configure this parameter.', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', description='The ID of the corresponding Secret.', example='10'),
  imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if the **PackageType** parameter is set to **Image**.', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  initContainersConfigShrink?: string(name='InitContainersConfig'),
  jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Xms4G -Xmx4G'),
  jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='custom-option'),
  jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
  kafkaConfigs?: string(name='KafkaConfigs', description='The logging configurations of Message Queue for Apache Kafka. Take note of the following rules:

*   **kafkaEndpoint**: the endpoint of the Message Queue for Apache Kafka API.
*   **kafkaInstanceId**: the ID of the Message Queue for Apache Kafka instance.
*   **kafkaConfigs**: One or more logging configurations of Message Queue for Apache Kafka. For information about sample values and parameters, see the request parameter **KafkaLogfileConfig** in this topic.', example='{"kafkaEndpoint":"10.0.X.XXX:XXXX,10.0.X.XXX:XXXX,10.0.X.XXX:XXXX\\\\","kafkaInstanceId":"alikafka_pre-cn-7pp2l8kr****","kafkaConfigs":[{"logType":"file_log","logDir":"/tmp/a.log","kafkaTopic":"test2"},{"logType":"stdout","logDir":"","kafkaTopic":"test"}]}'),
  liveness?: string(name='Liveness', description='The details of the availability check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. You can use one of the following methods to perform the health check:

*   Example of **exec**: `{"exec":{"command":["sh","-c","cat/home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}`
*   Sample code of the **httpGet** method: `{"httpGet":{"path":"/","port":18091,"scheme":"HTTP","isContainKeyWord":true,"keyWord":"SAE"},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`
*   Sample code of the **tcpSocket** method: `{"tcpSocket":{"port":18091},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`

> You can use only one method to perform the health check.

The following table describes the parameters that are used in the preceding statements.

*   **exec.command**: the health check command.
*   **httpGet.path**: the request path.
*   **httpGet.scheme**: the protocol that is used to perform the health check. Valid values: **HTTP** and **HTTPS**.
*   **httpGet.isContainKeyWord**: indicates whether the response contains keywords. Valid values: **true** and **false**. If this field is not returned, the advanced settings are not used.
*   **httpGet.keyWord**: the custom keyword. This parameter is available only if the **isContainKeyWord** field is returned.
*   **tcpSocket.port**: the port that is used to check the status of TCP connections.
*   **initialDelaySeconds**: the delay of the health check. Default value: 10. Unit: seconds.
*   **periodSeconds**: the interval at which health checks are performed. Default value: 30. Unit: seconds.
*   **timeoutSeconds**: the timeout period of the health check. Default value: 1. Unit: seconds. If you set this parameter to 0 or leave this parameter empty, the timeout period is automatically set to 1 second.', example='{"exec":{"command":["sleep","5s"]},"initialDelaySeconds":10,"timeoutSeconds":11}'),
  memory?: int32(name='Memory', example='1024'),
  microRegistration?: string(name='MicroRegistration', description='The Nacos registry. Valid values:

*   **0**: SAE built-in Nacos registry
*   **1**: self-managed Nacos registry
*   **2** : MSE Nacos registry', example='"0"'),
  microRegistrationConfig?: string(name='MicroRegistrationConfig', example='{\\\\"instanceId\\\\":\\\\"mse-cn-zvp2bh6h70r\\\\",\\\\"namespace\\\\":\\\\"4c0aa74f-57cb-423c-b6af-5d9f2d0e3dbd\\\\"}'),
  microserviceEngineConfig?: string(name='MicroserviceEngineConfig'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. Default value: -1.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

> When both **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of **MinReadyInstanceRatio**** takes precedence. For example, if **MinReadyInstances** is set to **5, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Special values:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
  mountDesc?: string(name='MountDesc', description='The configurations for mounting the NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **MountDesc** parameter in the requests. If you want to unmount the NAS file system, you must set the **MountDesc** values in the subsequent requests to an empty string ("").', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the **MountHost** parameter empty in the request.', example='10d3b4bc9****.com'),
  nasConfigs?: string(name='NasConfigs', description='The configurations of mounting the NAS file system. Take note of the following rules:

*   **mountPath**: the mount path of the container.
*   **readOnly**: If you set the value to **false**, the application has the read and write permissions.
*   **nasId**: the ID of the NAS file system.
*   **mountDomain**: the domain name of the mount target. For more information, see [DescribeMountTargets](https://help.aliyun.com/document_detail/62626.html).
*   **nasPath**: the directory in the NAS file system.', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
  nasId?: string(name='NasId', description='The ID of the File Storage NAS file system. After the application is created, you may want to call other operations to manage the application. If you do not want to change the NAS configurations in these subsequent operations, you can omit the **NasId** parameter in the requests. If you want to unmount the NAS file system, you must set the **NasId** values in the subsequent requests to an empty string ("").', example='10d3b4****'),
  newSaeVersion?: string(name='NewSaeVersion'),
  oidcRoleName?: string(name='OidcRoleName', description='The name of the RAM role used to authenticate the user identity.

>  You need to create an OpenID Connect (OIDC) identity provider (IdP) and an identity provider (IdP) for role-based single sign-on (SSO) in advance. For more information, see [Creates an OpenID Connect (OIDC) identity provider (IdP)](https://help.aliyun.com/document_detail/2331022.html) and [Creates an identity provider (IdP) for role-based single sign-on (SSO)](https://help.aliyun.com/document_detail/2331016.html).', example='sae-test'),
  ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS buckets.', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='Information of the Object Storage Service (OSS) bucket mounted to the application. The following table describes the parameters that are used in the preceding statements.

*   **bucketName**: the name of the OSS bucket.

*   **bucketPath**: the directory or object in OSS. If the specified directory or object does not exist, an error is returned.

*   **mountPath**: the directory of the container in SAE. If the path already exists, the newly specified path overwrites the previous one. If the path does not exist, it is created.

*   **readOnly**: specifies whether to only allow the container path to read data from the OSS directory. Valid values:

    *   **true**: The container path only has read permission on the OSS directory.
    *   **false**: The application has read and write permissions.', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageType?: string(name='PackageType', example='FatJar'),
  packageUrl?: string(name='PackageUrl', description='The address of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PythonZip**.', example='http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PythonZip**.', example='1.0.1'),
  php?: string(name='Php', example='PHP-FPM 7.0'),
  phpArmsConfigLocation?: string(name='PhpArmsConfigLocation', description='The path on which the PHP configuration file for application monitoring is mounted. Make sure that the PHP server loads the configuration file. SAE automatically generates the corresponding configuration file. No manual operations are required.', example='/usr/local/etc/php/conf.d/arms.ini'),
  phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='The script that is run immediately after the container is started. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  pvtzDiscoverySvc?: string(name='PvtzDiscoverySvc', description='The configurations of Kubernetes Service-based service registration and discovery. Take note of the following rules:

*   **serviceName**: the name of the Alibaba Cloud service. Format: `<Custom content>-<Namespace ID>`. `-<Namespace ID>` is automatically specified based on the namespace in which an application resides and cannot be changed. For example, if you select the default namespace in the China (Beijing) region, `-cn-beijing-default` is automatically specified.
*   **namespaceId**: the namespace ID.
*   **portAndProtocol**: the port number and protocol. Valid values of the port number: 1 to 65535. Valid values of the protocol: **TCP** and **UDP**.
*   **enable**: enables the Kubernetes Service-based registration and discovery feature.', example='{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true}'),
  python?: string(name='Python', description='The Python environment. Set the value to **PYTHON 3.9.15**.', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', description='The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box.', example='Flask==2.0'),
  readiness?: string(name='Readiness', description='The details of the health check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. Containers that fail health checks cannot receive traffic from Server Load Balancer (SLB) instances. You can use the **exec**, **httpGet**, or **tcpSocket** method to perform health checks. For more information, see the description of the **Liveness** parameter.

> You can use only one method to perform the health check.', example='{"exec":{"command":["sleep","6s"]},"initialDelaySeconds":15,"timeoutSeconds":12}'),
  replicas?: int32(name='Replicas', example='1'),
  secretMountDesc?: string(name='SecretMountDesc', example='[{“secretId":10,”key":"test","mountPath":"/tmp"}]'),
  securityGroupId?: string(name='SecurityGroupId', example='sg-wz969ngg2e49q5i4****'),
  serviceTags?: string(name='ServiceTags', example='{\\\\"alicloud.service.tag\\\\":\\\\"g1\\\\"}'),
  sidecarContainersConfigShrink?: string(name='SidecarContainersConfig', description='The configuration of the container.'),
  slsConfigs?: string(name='SlsConfigs', description='The logging configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

The following table describes the parameters that are used in the preceding statements.

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the **SlsConfigs** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the **SlsConfigs** parameter empty in the request.

> A Log Service project that is automatically created by SAE when you create an application is deleted when the application is deleted. Therefore, when you create an application, you cannot select a Log Service project that is automatically created by SAE for log collection.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  swimlanePvtzDiscoverySvc?: string(name='SwimlanePvtzDiscoverySvc'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
  timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to cancel this configuration, set this parameter to "" or "{}". The following variables are included in the configuration: Take note of the following rules:

*   **port**: the port number. The port number ranges from 1024 to 65535. Though the admin permissions are configured for the container, the root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not specify this parameter, the default port number 8080 is used.
*   **contextPath**: the path. Default value: /. This value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312.************ If you do not specify this parameter, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: specifies whether to use the encoding scheme specified in the request body for URI query parameters. Default value: true.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  updateStrategy?: string(name='UpdateStrategy', description='The deployment policy. If the minimum number of available instances is 1, the value of the **UpdateStrategy** parameter is an empty string (""). If the minimum number of available instances is greater than 1, the following strategies can be configured:

*   The application is deployed on an instance. The remaining instances are automatically classified into two release batches whose interval is set to 1. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}`.
*   The application is deployed on an instance. The remaining instances are manually classified into two release batches. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}`.
*   All instances are automatically classified into two release batches. The application is deployed on the instances of the two batches in parallel. In this case, the parameter is set to `{"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}`

The following table describes the parameters that are used in the preceding statements.

*   **type**: the type of the release policy. Valid values: **GrayBatchUpdate** and **BatchUpdate**.

*   **batchUpdate**: the phased release policy.

    *   **batch**: the number of release batches.
    *   **releaseType**: the processing method for the batches. Valid values: **auto** and **manual**.
    *   **batchWaitTime**: the interval between release batches. Unit: seconds.

*   **grayUpdate**: the number of release batches in the phased release after a canary release. This parameter is returned only if the **type** parameter is set to **GrayBatchUpdate**.', example='{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}'),
  vSwitchId?: string(name='VSwitchId', example='vsw-bp12mw1f8k3jgygk9****'),
  warStartOptions?: string(name='WarStartOptions', description='The startup command of the WAR package. For information about how to configure the startup command, see [Configure startup commands](https://help.aliyun.com/document_detail/96677.html).', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. Valid values:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='apache-tomcat-7.0.91'),
}

model DeployApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. It can be used to query the task status.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
    isNeedApproval?: boolean(name='IsNeedApproval', description='Specifies whether approval is required when a RAM user performs release. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3***'),
  success?: boolean(name='Success', description='Indicates whether the application deployment is successful. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622246421415014e****'),
}

model DeployApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeployApplicationResponseBody(name='body'),
}

/**
 * @summary Deploys an application.
 *
 * @param tmpReq DeployApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeployApplicationResponse
 */
async function deployApplicationWithOptions(tmpReq: DeployApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): DeployApplicationResponse {
  tmpReq.validate();
  var request = new DeployApplicationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.initContainersConfig)) {
    request.initContainersConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.initContainersConfig, 'InitContainersConfig', 'json');
  }
  if (!$isNull(tmpReq.sidecarContainersConfig)) {
    request.sidecarContainersConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sidecarContainersConfig, 'SidecarContainersConfig', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.acrAssumeRoleArn)) {
    query['AcrAssumeRoleArn'] = request.acrAssumeRoleArn;
  }
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.autoEnableApplicationScalingRule)) {
    query['AutoEnableApplicationScalingRule'] = request.autoEnableApplicationScalingRule;
  }
  if (!$isNull(request.batchWaitTime)) {
    query['BatchWaitTime'] = request.batchWaitTime;
  }
  if (!$isNull(request.changeOrderDesc)) {
    query['ChangeOrderDesc'] = request.changeOrderDesc;
  }
  if (!$isNull(request.command)) {
    query['Command'] = request.command;
  }
  if (!$isNull(request.commandArgs)) {
    query['CommandArgs'] = request.commandArgs;
  }
  if (!$isNull(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!$isNull(request.customHostAlias)) {
    query['CustomHostAlias'] = request.customHostAlias;
  }
  if (!$isNull(request.customImageNetworkType)) {
    query['CustomImageNetworkType'] = request.customImageNetworkType;
  }
  if (!$isNull(request.deploy)) {
    query['Deploy'] = request.deploy;
  }
  if (!$isNull(request.dotnet)) {
    query['Dotnet'] = request.dotnet;
  }
  if (!$isNull(request.edasContainerVersion)) {
    query['EdasContainerVersion'] = request.edasContainerVersion;
  }
  if (!$isNull(request.enableAhas)) {
    query['EnableAhas'] = request.enableAhas;
  }
  if (!$isNull(request.enableCpuBurst)) {
    query['EnableCpuBurst'] = request.enableCpuBurst;
  }
  if (!$isNull(request.enableGreyTagRoute)) {
    query['EnableGreyTagRoute'] = request.enableGreyTagRoute;
  }
  if (!$isNull(request.enableNewArms)) {
    query['EnableNewArms'] = request.enableNewArms;
  }
  if (!$isNull(request.envs)) {
    query['Envs'] = request.envs;
  }
  if (!$isNull(request.imagePullSecrets)) {
    query['ImagePullSecrets'] = request.imagePullSecrets;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.jarStartArgs)) {
    query['JarStartArgs'] = request.jarStartArgs;
  }
  if (!$isNull(request.jarStartOptions)) {
    query['JarStartOptions'] = request.jarStartOptions;
  }
  if (!$isNull(request.jdk)) {
    query['Jdk'] = request.jdk;
  }
  if (!$isNull(request.kafkaConfigs)) {
    query['KafkaConfigs'] = request.kafkaConfigs;
  }
  if (!$isNull(request.liveness)) {
    query['Liveness'] = request.liveness;
  }
  if (!$isNull(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!$isNull(request.microRegistration)) {
    query['MicroRegistration'] = request.microRegistration;
  }
  if (!$isNull(request.microserviceEngineConfig)) {
    query['MicroserviceEngineConfig'] = request.microserviceEngineConfig;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }
  if (!$isNull(request.mountDesc)) {
    query['MountDesc'] = request.mountDesc;
  }
  if (!$isNull(request.mountHost)) {
    query['MountHost'] = request.mountHost;
  }
  if (!$isNull(request.nasConfigs)) {
    query['NasConfigs'] = request.nasConfigs;
  }
  if (!$isNull(request.nasId)) {
    query['NasId'] = request.nasId;
  }
  if (!$isNull(request.newSaeVersion)) {
    query['NewSaeVersion'] = request.newSaeVersion;
  }
  if (!$isNull(request.oidcRoleName)) {
    query['OidcRoleName'] = request.oidcRoleName;
  }
  if (!$isNull(request.packageType)) {
    query['PackageType'] = request.packageType;
  }
  if (!$isNull(request.packageUrl)) {
    query['PackageUrl'] = request.packageUrl;
  }
  if (!$isNull(request.packageVersion)) {
    query['PackageVersion'] = request.packageVersion;
  }
  if (!$isNull(request.phpArmsConfigLocation)) {
    query['PhpArmsConfigLocation'] = request.phpArmsConfigLocation;
  }
  if (!$isNull(request.phpConfigLocation)) {
    query['PhpConfigLocation'] = request.phpConfigLocation;
  }
  if (!$isNull(request.postStart)) {
    query['PostStart'] = request.postStart;
  }
  if (!$isNull(request.preStop)) {
    query['PreStop'] = request.preStop;
  }
  if (!$isNull(request.pvtzDiscoverySvc)) {
    query['PvtzDiscoverySvc'] = request.pvtzDiscoverySvc;
  }
  if (!$isNull(request.python)) {
    query['Python'] = request.python;
  }
  if (!$isNull(request.pythonModules)) {
    query['PythonModules'] = request.pythonModules;
  }
  if (!$isNull(request.readiness)) {
    query['Readiness'] = request.readiness;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }
  if (!$isNull(request.secretMountDesc)) {
    query['SecretMountDesc'] = request.secretMountDesc;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!$isNull(request.slsConfigs)) {
    query['SlsConfigs'] = request.slsConfigs;
  }
  if (!$isNull(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!$isNull(request.timezone)) {
    query['Timezone'] = request.timezone;
  }
  if (!$isNull(request.tomcatConfig)) {
    query['TomcatConfig'] = request.tomcatConfig;
  }
  if (!$isNull(request.updateStrategy)) {
    query['UpdateStrategy'] = request.updateStrategy;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.warStartOptions)) {
    query['WarStartOptions'] = request.warStartOptions;
  }
  if (!$isNull(request.webContainer)) {
    query['WebContainer'] = request.webContainer;
  }

  var body : map[string]any = {};
  if (!$isNull(request.acrInstanceId)) {
    body['AcrInstanceId'] = request.acrInstanceId;
  }
  if (!$isNull(request.associateEip)) {
    body['AssociateEip'] = request.associateEip;
  }
  if (!$isNull(request.configMapMountDesc)) {
    body['ConfigMapMountDesc'] = request.configMapMountDesc;
  }
  if (!$isNull(request.enableSidecarResourceIsolated)) {
    body['EnableSidecarResourceIsolated'] = request.enableSidecarResourceIsolated;
  }
  if (!$isNull(request.initContainersConfigShrink)) {
    body['InitContainersConfig'] = request.initContainersConfigShrink;
  }
  if (!$isNull(request.microRegistrationConfig)) {
    body['MicroRegistrationConfig'] = request.microRegistrationConfig;
  }
  if (!$isNull(request.ossAkId)) {
    body['OssAkId'] = request.ossAkId;
  }
  if (!$isNull(request.ossAkSecret)) {
    body['OssAkSecret'] = request.ossAkSecret;
  }
  if (!$isNull(request.ossMountDescs)) {
    body['OssMountDescs'] = request.ossMountDescs;
  }
  if (!$isNull(request.php)) {
    body['Php'] = request.php;
  }
  if (!$isNull(request.phpConfig)) {
    body['PhpConfig'] = request.phpConfig;
  }
  if (!$isNull(request.serviceTags)) {
    body['ServiceTags'] = request.serviceTags;
  }
  if (!$isNull(request.sidecarContainersConfigShrink)) {
    body['SidecarContainersConfig'] = request.sidecarContainersConfigShrink;
  }
  if (!$isNull(request.swimlanePvtzDiscoverySvc)) {
    body['SwimlanePvtzDiscoverySvc'] = request.swimlanePvtzDiscoverySvc;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeployApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/deployApplication`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deploys an application.
 *
 * @param request DeployApplicationRequest
 * @return DeployApplicationResponse
 */
async function deployApplication(request: DeployApplicationRequest): DeployApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deployApplicationWithOptions(request, headers, runtime);
}

model DescribeAppServiceDetailRequest {
  appId?: string(name='AppId', description='6dcc8c9e-d3da-478a-a066-86dcf820\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='6dcc8c9e-d3da-478a-a066-86dcf820****'),
  nacosInstanceId?: string(name='NacosInstanceId', description='The ID of the MSE Nacos instance.', example='mse-cn-sco3r0u****'),
  nacosNamespaceId?: string(name='NacosNamespaceId', description='The ID of the namespace for the MSE Nacos instance.', example='public'),
  serviceGroup?: string(name='ServiceGroup', description='springCloud', example='springCloud'),
  serviceName?: string(name='ServiceName', description='edas.service.provider', example='edas.service.provider'),
  serviceType?: string(name='ServiceType', description='springCloud', example='springCloud'),
  serviceVersion?: string(name='ServiceVersion', description='1.0.0', example='1.0.0'),
}

model DescribeAppServiceDetailResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

- **2xx**: indicates that the call was successful.
- **3xx**: indicates that the call was redirected.
- **4xx**: indicates that the call failed.
- **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    dubboApplicationName?: string(name='DubboApplicationName', description='The name of the Dubbo application.', example='service-consumer'),
    edasAppName?: string(name='EdasAppName', description='The name of the application.', example='cn-zhangjiakou-micro-service-******'),
    group?: string(name='Group', description='The group to which the service belongs. You can create a custom group.', example='springCloud'),
    metadata?: map[string]any(name='Metadata', description='The metadata. Example: `{side: "provider", port: "18081", preserved: {register: {source: "SPRING_CLOUD"}},…}`.', example='{side: "provider", port: "18081", preserved: {register: {source: "SPRING_CLOUD"}},…}'),
    methods?: [ 
      {
        methodController?: string(name='MethodController', description='The class to which the method belongs.', example='com.serverless.sae.controller.EchoController'),
        name?: string(name='Name', description='The name of the method.', example='echo'),
        nameDetail?: string(name='NameDetail', description='The details of the method.', example='description'),
        parameterDefinitions?: [ 
          {
            description?: string(name='Description', description='The description of the parameter.', example='description'),
            name?: string(name='Name', description='The name of the parameter.', example='arg0'),
            type?: string(name='Type', description='The type of the parameter.', example='java.lang.String'),
          }
        ](name='ParameterDefinitions', description='The definition of the parameter.'),
        parameterDetails?: [ string ](name='ParameterDetails', description='The details of the parameters.'),
        parameterTypes?: [ string ](name='ParameterTypes', description='The types of the parameters.'),
        paths?: [ string ](name='Paths', description='The request paths. Format:

`/path`'),
        requestMethods?: [ string ](name='RequestMethods', description='The request methods. Valid values:

*   **GET**
*   **ALL**'),
        returnDetails?: string(name='ReturnDetails', description='The details of the response.', example='test'),
        returnType?: string(name='ReturnType', description='The data format of the response.', example='java.lang.String'),
      }
    ](name='Methods', description='The methods.'),
    serviceName?: string(name='ServiceName', description='The name of the service.', example='service-provider'),
    servicePorts?: [ long ](name='ServicePorts', description='The port used by the service.'),
    serviceProtocol?: string(name='ServiceProtocol', description='The protocol used by the service.', example='HTTP'),
    serviceTags?: [ string ](name='ServiceTags', description='The tag of the service.'),
    serviceType?: string(name='ServiceType', description='The type of the service. Valid values:

*   **dubbo**
*   **springCloud**', example='springCloud'),
    springApplicationName?: string(name='SpringApplicationName', description='The name of the Spring Cloud application.', example='service-provider'),
    version?: string(name='Version', description='The version of the service. You can create a custom version.', example='1.0.0'),
  }(name='Data', description='The data that is returned.'),
  errorCode?: string(name='ErrorCode', description='The returned error code. Valid values:

- If the call is successful, the **ErrorCode** parameter is not returned.
- If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.'),
  message?: string(name='Message', description='The returned information.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B2C7874F-F109-5B34-8618-2C10BBA2****'),
  success?: boolean(name='Success', description='Indicates whether the meta data was obtained. Valid values:

*   **true**: The metadata was obtained.
*   **false**: The metadata failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0b16399316402420740034918e****'),
}

model DescribeAppServiceDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppServiceDetailResponseBody(name='body'),
}

/**
 * @summary Queries the metadata details of the service of an application.
 *
 * @param request DescribeAppServiceDetailRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAppServiceDetailResponse
 */
async function describeAppServiceDetailWithOptions(request: DescribeAppServiceDetailRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeAppServiceDetailResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.nacosInstanceId)) {
    query['NacosInstanceId'] = request.nacosInstanceId;
  }
  if (!$isNull(request.nacosNamespaceId)) {
    query['NacosNamespaceId'] = request.nacosNamespaceId;
  }
  if (!$isNull(request.serviceGroup)) {
    query['ServiceGroup'] = request.serviceGroup;
  }
  if (!$isNull(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  if (!$isNull(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!$isNull(request.serviceVersion)) {
    query['ServiceVersion'] = request.serviceVersion;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAppServiceDetail',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/service/describeAppServiceDetail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the metadata details of the service of an application.
 *
 * @param request DescribeAppServiceDetailRequest
 * @return DescribeAppServiceDetailResponse
 */
async function describeAppServiceDetail(request: DescribeAppServiceDetailRequest): DescribeAppServiceDetailResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeAppServiceDetailWithOptions(request, headers, runtime);
}

model DescribeApplicationConfigRequest {
  appId?: string(name='AppId', description='7171a6ca-d1cd-4928-8642-7d5cfe69\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  versionId?: string(name='VersionId', description='0026ff7f-2b57-4127-bdd0-9bf202bb\\\\*\\\\*\\\\*\\\\*', example='0026ff7f-2b57-4127-bdd0-9bf202bb****'),
}

model DescribeApplicationConfigResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the RAM role that is used to pull images across accounts. For more information, see [Pull images across Alibaba Cloud accounts](https://help.aliyun.com/document_detail/190675.html) and [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
    acrInstanceId?: string(name='AcrInstanceId', description='The ID of the Container Registry Enterprise Edition instance.', example='cri-xxxxxx'),
    appDescription?: string(name='AppDescription', description='The description of the application.'),
    appId?: string(name='AppId', description='The ID of the application.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    appName?: string(name='AppName', description='The name of the application.', example='demo-app'),
    appSource?: string(name='AppSource', description='The SAE application type.

*   micro_service
*   web
*   job', example='micro_service'),
    associateEip?: boolean(name='AssociateEip', description='Indicates whether an elastic IP address (EIP) is associated with the application instance. Valid values:

*   **true**: The EIP is associated with the application instance.
*   **false**: The EIP is not associated with the application instance.', example='true'),
    baseAppId?: string(name='BaseAppId'),
    batchWaitTime?: int32(name='BatchWaitTime', description='The interval between batches in a phased release. Unit: seconds.', example='10'),
    clusterId?: string(name='ClusterId'),
    command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Example:

```

command:
      - echo
      - abc
      - >
      - file0
```

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
    commandArgs?: string(name='CommandArgs', description='The parameters of the image startup command. The CommandArgs parameter contains the parameters that are required for the **Command** parameter. Format:

`["a","b"]`

In the preceding **Command** example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. You do not need to configure this parameter if it does not exist in the Command parameter.', example='["a","b"]'),
    configMapMountDesc?: [ 
      {
        configMapId?: long(name='ConfigMapId', description='The ID of the ConfigMap.', example='1'),
        configMapName?: string(name='ConfigMapName', description='The name of the ConfigMap.', example='test'),
        key?: string(name='Key', description='The key-value pair that is stored in the ConfigMap.', example='k1'),
        mountPath?: string(name='MountPath', description='The path on which the ConfigMap is mounted.', example='/tmp'),
      }
    ](name='ConfigMapMountDesc', description='The details of the ConfigMap.'),
    cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. You cannot set this parameter to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **16000**
*   **32000**', example='1000'),
    customHostAlias?: string(name='CustomHostAlias', description='The custom mappings between hostnames and IP addresses in the container. Valid values:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"test.host.name","ip":"0.0.0.0"}]'),
    customImageNetworkType?: string(name='CustomImageNetworkType'),
    diskSize?: int32(name='DiskSize'),
    dotnet?: string(name='Dotnet'),
    edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
    enableAhas?: string(name='EnableAhas', description='Indicates whether access to Application High Availability Service (AHAS) is enabled. Valid values:

*   **true**: Access to AHAS is enabled.
*   **false**: Access to AHAS is disabled.', example='true'),
    enableCpuBurst?: string(name='EnableCpuBurst'),
    enableGreyTagRoute?: boolean(name='EnableGreyTagRoute', description='Indicates whether canary release rules are enabled. Canary release rules apply only to applications in Spring Cloud and Dubbo frameworks. Valid values:

*   **true**: The canary release rules are enabled.
*   **false**: The canary release rules are disabled.', example='false'),
    enableIdle?: boolean(name='EnableIdle'),
    enableNewArms?: boolean(name='EnableNewArms'),
    envs?: string(name='Envs', description='The environment variables. Variable description:

*   **name**: the name of the environment variable.
*   **value**: the value or reference of the environment variable.', example='[{"name":"TEST_ENV_KEY","value":"TEST_ENV_VAR"}]'),
    imagePullSecrets?: string(name='ImagePullSecrets', example='10'),
    imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if the **PackageType** parameter is set to **Image**.', example='docker.io/library/nginx:1.14.2'),
    initContainersConfig?: [ 
      {
        command?: string(name='Command'),
        commandArgs?: string(name='CommandArgs'),
        configMapMountDesc?: [ 
          {
            configMapId?: long(name='ConfigMapId'),
            configMapName?: string(name='ConfigMapName'),
            key?: string(name='Key'),
            mountPath?: string(name='MountPath'),
          }
        ](name='ConfigMapMountDesc'),
        envs?: string(name='Envs'),
        imageUrl?: string(name='ImageUrl'),
        name?: string(name='Name'),
      }
    ](name='InitContainersConfig'),
    jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='start'),
    jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Dtest=true'),
    jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
    kafkaConfigs?: string(name='KafkaConfigs', description='The logging configurations of Message Queue for Apache Kafka. The following parameters are involved:

*   **KafkaConfigs**: the configurations of Message Queue for Apache Kafka.

*   **createTime**: the time when the Message Queue for Apache Kafka instance was created.

*   **kafkaTopic**: the message topic that is used to classify messages.

*   **logDir**: the path in which logs are stored.

*   **logType**: the type of collected logs. Valid values:

    *   **file_log**: the file log that is stored in the container. The path of the file logs in the container is returned.
    *   **stdout**: the standard output log of the container. You can specify only one stdout value.

*   **kafkaEndpoint**: the endpoint of the Message Queue for Apache Kafka service.

*   **kafkaInstanceId**: the ID of the Message Queue for Apache Kafka instance.

*   **region**: the region where the Message Queue for Apache Kafka instance resides.'),
    liveness?: string(name='Liveness', description='The details of the availability check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. You can use one of the following methods to perform the health check:

*   Sample code of the **exec** method: `{"exec":{"command":["sh","-c","cat/home/admin/start.sh"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":2}`
*   Sample code of the **httpGet** method: `{"httpGet":{"path":"/","port":18091,"scheme":"HTTP","isContainKeyWord":true,"keyWord":"SAE"},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`
*   Sample code of the **tcpSocket** method: `{"tcpSocket":{"port":18091},"initialDelaySeconds":11,"periodSeconds":10,"timeoutSeconds":1}`

>  You can use only one method to perform the health check.

The following parameters are involved:

*   **exec.command**: the health check command.
*   **httpGet.path**: the request path.
*   **httpGet.scheme**: the protocol that is used to perform the health check. Valid values: **HTTP** and **HTTPS**.
*   **httpGet.isContainKeyWord**: indicates whether the response contains keywords. Valid values: **true** and **false**. If this field is not returned, the advanced settings are not used.
*   **httpGet.keyWord**: the custom keyword. This parameter is available only if the **isContainKeyWord** field is returned.
*   **tcpSocket.port**: the port that is used to check the status of TCP connections.
*   **initialDelaySeconds**: the delay of the health check. Default value: 10. Unit: seconds.
*   **periodSeconds**: the interval at which health checks are performed. Default value: 30. Unit: seconds.
*   **timeoutSeconds**: the timeout period of the health check. Default value: 1. Unit: seconds. If you set this parameter to 0 or leave this parameter empty, the timeout period is automatically set to 1 second.', example='{"exec":{"command":["curl http://localhost:8080"]},"initialDelaySeconds":20,"timeoutSeconds":3}'),
    memory?: int32(name='Memory', description='The size of memory required by each instance. Unit: MB. You cannot set this parameter to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 1000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24567** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.', example='2048'),
    microRegistration?: string(name='MicroRegistration', example='"0"'),
    microRegistrationConfig?: string(name='MicroRegistrationConfig'),
    microserviceEngineConfig?: string(name='MicroserviceEngineConfig'),
    minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Valid values:

*   **-1**: the default value. This value indicates that the minimum number of available instances is not measured by percentage. If you do not configure this parameter, the default value **-1** is used.
*   **0 to 100**: indicates that the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). If the calculated result is not an integer, the result is rounded up to the nearest integer. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

>  If the **MinReadyInstance** and **MinReadyInstanceRatio** parameters are returned and the value of the **MinReadyInstanceRatio** parameter is not **-1**, the value of the **MinReadyInstanceRatio** parameter takes effect. If the **MinReadyInstances** parameter is set to **5** and the **MinReadyInstanceRatio** parameter is set to **50**, the value of the **MinReadyInstanceRatio** parameter determines the minimum number of available instances.', example='-1'),
    minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Valid values:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to **-1**, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

>  Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
    mountDesc?: [ 
      {
        mountPath?: string(name='MountPath', description='The path on which the NAS file system is mounted.', example='/tmp'),
        nasPath?: string(name='NasPath', description='The directory in the NAS file system.', example='/'),
      }
    ](name='MountDesc', description='The details of the mounted NAS file system.'),
    mountHost?: string(name='MountHost', description='The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the **MountHost** parameter empty in the request.', example='example.com'),
    mseApplicationId?: string(name='MseApplicationId', description='The ID of the microservice application.', example='xxxxxxx@xxxxx'),
    mseApplicationName?: string(name='MseApplicationName', example='cn-shenzhen-alb-demo-5c****'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-beijing:test'),
    nasConfigs?: string(name='NasConfigs', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
    nasId?: string(name='NasId', description='The ID of the NAS file system.', example='AKSN89**'),
    newSaeVersion?: string(name='NewSaeVersion'),
    oidcRoleName?: string(name='OidcRoleName'),
    ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS) buckets.', example='xxxxxx'),
    ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS buckets.', example='xxxxxx'),
    ossMountDescs?: [ 
      {
        bucketName?: string(name='bucketName', description='The name of the OSS bucket.', example='oss-bucket'),
        bucketPath?: string(name='bucketPath', description='The directory or object in OSS. If the specified directory or object does not exist, an error is returned.', example='data/user.data'),
        mountPath?: string(name='mountPath', description='The path of the container in SAE. The parameter value that you specified overwrites the original value. If the specified path does not exist, SAE automatically creates the path.', example='/usr/data/user.data'),
        readOnly?: boolean(name='readOnly', description='Indicates whether the application can use the container path to read data from or write data to resources in the directory of the OSS bucket. Valid values:

*   **true**: The application has the read-only permissions.
*   **false**: The application has the read and write permissions.', example='true'),
      }
    ](name='OssMountDescs', description='The description of the mounted OSS bucket.'),
    packageType?: string(name='PackageType', description='The type of the deployment package. Valid values:

*   If you deploy the application by using a Java Archive (JAR) package, you can set this parameter to **FatJar**, **War**, or **Image**.

*   If you deploy the application by using a PHP package, you can set this parameter to one of the following values:

    *   **PhpZip**
    *   **IMAGE_PHP_5_4**
    *   **IMAGE_PHP_5_4_ALPINE**
    *   **IMAGE_PHP_5_5**
    *   **IMAGE_PHP_5_5_ALPINE**
    *   **IMAGE_PHP_5_6**
    *   **IMAGE_PHP_5_6_ALPINE**
    *   **IMAGE_PHP_7_0**
    *   **IMAGE_PHP_7_0_ALPINE**
    *   **IMAGE_PHP_7_1**
    *   **IMAGE_PHP_7_1_ALPINE**
    *   **IMAGE_PHP_7_2**
    *   **IMAGE_PHP_7_2_ALPINE**
    *   **IMAGE_PHP_7_3**
    *   **IMAGE_PHP_7_3_ALPINE**', example='War'),
    packageUrl?: string(name='PackageUrl', description='The URL of the deployment package. This parameter is returned only if the **PackageType** parameter is set to **FatJar** or **War**.'),
    packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is returned only if the **PackageType** parameter is set to **FatJar** or **War**.', example='1.0'),
    php?: string(name='Php', example='PHP-FPM 7.0'),
    phpArmsConfigLocation?: string(name='PhpArmsConfigLocation', description='The path on which the PHP configuration file for application monitoring is mounted. Make sure that the PHP server loads the configuration file.

SAE automatically generates the corresponding configuration file. No manual operations are required.', example='/usr/local/etc/php/conf.d/arms.ini'),
    phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
    phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
    postStart?: string(name='PostStart', description='The script that is run immediately after the container is started. Example: `{"exec":{"command":["cat","/etc/group"]}}`', example='{"exec":{"command":["cat","/etc/group"]}}'),
    preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["cat","/etc/group"]}}`', example='{"exec":{"command":["cat","/etc/group"]}}'),
    programmingLanguage?: string(name='ProgrammingLanguage', description='The programming language that is used to create the application. Valid values:

*   **java**: Java
*   **php**: PHP
*   **other**: Other programming languages, such as Python, C++, Go, .NET, and Node.js.', example='java'),
    pvtzDiscovery?: string(name='PvtzDiscovery', example='{"serviceName":"bwm-poc-sc-gateway-cn-beijing-front","namespaceId":"cn-beijing:front","portAndProtocol":{"18012":"TCP"},"enable":true}'),
    python?: string(name='Python', example='PYTHON 3.9.15'),
    pythonModules?: string(name='PythonModules', example='Flask==2.0'),
    readiness?: string(name='Readiness', description='The details of the health check that was performed on the container. If the container fails this health check multiple times, the system disables and restarts the container. Containers that fail health checks cannot receive traffic from Server Load Balancer (SLB) instances. You can use the **exec**, **httpGet**, or **tcpSocket** method to perform health checks. For more information, see the description of the **Liveness** parameter.

>  You can use only one method to perform the health check.', example='{"exec":{"command":["curl http://localhost:8080"]},"initialDelaySeconds":20,"timeoutSeconds":5}'),
    regionId?: string(name='RegionId', description='The ID of the region.', example='cn-beijing'),
    replicas?: int32(name='Replicas', description='The number of application instances.', example='2'),
    resourceType?: string(name='ResourceType'),
    secretMountDesc?: [ 
      {
        key?: string(name='Key'),
        mountPath?: string(name='MountPath'),
        secretId?: long(name='SecretId'),
        secretName?: string(name='SecretName'),
      }
    ](name='SecretMountDesc'),
    securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-wz969ngg2e49q5i4****'),
    serviceTags?: map[string]string(name='ServiceTags', description='The canary tag configured for the application.'),
    sidecarContainersConfig?: [ 
      {
        acrInstanceId?: string(name='AcrInstanceId'),
        command?: string(name='Command'),
        commandArgs?: string(name='CommandArgs'),
        configMapMountDesc?: [ 
          {
            configMapId?: long(name='ConfigMapId'),
            configMapName?: string(name='ConfigMapName'),
            key?: string(name='Key'),
            mountPath?: string(name='MountPath'),
          }
        ](name='ConfigMapMountDesc'),
        cpu?: int32(name='Cpu'),
        emptyDirDesc?: [ 
          {
            mountPath?: string(name='MountPath'),
            name?: string(name='Name'),
          }
        ](name='EmptyDirDesc'),
        envs?: string(name='Envs'),
        imageUrl?: string(name='ImageUrl'),
        memory?: int32(name='Memory'),
        name?: string(name='Name'),
      }
    ](name='SidecarContainersConfig'),
    slsConfigs?: string(name='SlsConfigs', description='The logging configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

The following parameters are involved:

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the **SlsConfigs** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the **SlsConfigs** parameter empty in the request.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
    swimlanePvtzDiscovery?: string(name='SwimlanePvtzDiscovery'),
    tags?: [ 
      {
        key?: string(name='Key', description='The key of the tag.', example='k1'),
        value?: string(name='Value', description='The value of the tag.', example='v1'),
      }
    ](name='Tags', description='The details of the tags.'),
    terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
    timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
    tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to delete the configuration, set this parameter to {} or leave this parameter empty. The following parameters are involved:

*   **port**: the port number. Valid values: 1024 to 65535. The root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not configure this parameter, the default port number 8080 is used.
*   **contextPath**: the path. Default value: /. This value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: **UTF-8**, **ISO-8859-1**, **GBK**, and **GB2312**. If you do not configure this parameter, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: indicates whether to use the encoding scheme that is specified by **BodyEncoding for URL**. Default value: **true**.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
    updateStrategy?: string(name='UpdateStrategy', description='The deployment policy. If the minimum number of available instances is 1, the value of the **UpdateStrategy** parameter is an empty string (""). If the minimum number of available instances is greater than 1, the following strategies can be configured:

*   The application is deployed on an instance. The remaining instances are automatically classified into two release batches whose interval is set to 1. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}`.
*   The application is deployed on an instance. The remaining instances are manually classified into two release batches. In this case, the parameter is set to `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}`.
*   All instances are automatically classified into two release batches. The application is deployed on the instances of the two batches in parallel. In this case, the parameter is set to `{"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}`

The following parameters are involved:

*   **type**: the type of the release policy. Valid values: **GrayBatchUpdate** and **BatchUpdate**.

*   **batchUpdate**: the phased release policy.

    *   **batch**: the number of release batches.
    *   **releaseType**: the processing method for the batches. Valid values: **auto** and **manual**.
    *   **batchWaitTime**: the interval between release batches. Unit: seconds.

*   **grayUpdate**: the number of release batches in the phased release after a canary release. This parameter is returned only if the **type** parameter is set to **GrayBatchUpdate**.', example='{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}'),
    vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-2ze559r1z1bpwqxwp****'),
    vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-2ze0i263cnn311nvj****'),
    warStartOptions?: string(name='WarStartOptions', description='The option settings in the WAR package. The settings are used to start the application container. The default startup command is `java $JAVA_OPTS $CATALINA_OPTS -Options org.apache.catalina.startup.Bootstrap "$@" start`.', example='custom-option'),
    webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. Valid values:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='apache-tomcat-7.0.91'),
  }(name='Data', description='The information about the application.'),
  errorCode?: string(name='ErrorCode', description='The returned error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.'),
  message?: string(name='Message', description='The returned information.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3****'),
  success?: boolean(name='Success', description='Indicates whether the configurations of an application were obtained. Valid values:

*   **true**: The configurations were obtained.
*   **false**: The configurations failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622246421415014e****'),
}

model DescribeApplicationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationConfigResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of an application.
 *
 * @param request DescribeApplicationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationConfigResponse
 */
async function describeApplicationConfigWithOptions(request: DescribeApplicationConfigRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationConfigResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.versionId)) {
    query['VersionId'] = request.versionId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationConfig',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/describeApplicationConfig`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of an application.
 *
 * @param request DescribeApplicationConfigRequest
 * @return DescribeApplicationConfigResponse
 */
async function describeApplicationConfig(request: DescribeApplicationConfigRequest): DescribeApplicationConfigResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationConfigWithOptions(request, headers, runtime);
}

model DescribeApplicationGroupsRequest {
  appId?: string(name='AppId', description='d700e680-aa4d-4ec1-afc2-6566b5ff\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='d700e680-aa4d-4ec1-afc2-6566b5ff****'),
  currentPage?: int32(name='CurrentPage', description='1', example='1'),
  pageSize?: int32(name='PageSize', description='10', example='10'),
}

model DescribeApplicationGroupsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: [ 
    {
      edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which a High-speed Service Framework (HSF) application runs.', example='3.5.3'),
      groupId?: string(name='GroupId', description='The ID of the group.', example='b2a8a925-477a-eswa-b823-d5e22500****'),
      groupName?: string(name='GroupName', description='The name of the group.', example='_DEFAULT_GROUP'),
      groupType?: int32(name='GroupType', description='The type of the group.', example='0'),
      imageUrl?: string(name='ImageUrl', description='The address of the image. This parameter is required when the **PackageType** parameter is set to **Image**.', example='registry-vpc.cn-hangzhou.aliyuncs.com/demo/nginx:latest'),
      jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. This parameter is invalid when the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
      packageType?: string(name='PackageType', description='The type of the application deployment package. Valid values:

*   When you use a Java package, set this value to **FatJar**, **War**, or **Image**.

*   When you use a PHP package, the following values are valid:

    *   **PhpZip**
    *   **IMAGE_PHP_5_4**
    *   **IMAGE_PHP_5_4_ALPINE**
    *   **IMAGE_PHP_5_5**
    *   **IMAGE_PHP_5_5_ALPINE**
    *   **IMAGE_PHP_5_6**
    *   **IMAGE_PHP_5_6_ALPINE**
    *   **IMAGE_PHP_7_0**
    *   **IMAGE_PHP_7_0_ALPINE**
    *   **IMAGE_PHP_7_1**
    *   **IMAGE_PHP_7_1_ALPINE**
    *   **IMAGE_PHP_7_2**
    *   **IMAGE_PHP_7_2_ALPINE**
    *   **IMAGE_PHP_7_3**
    *   **IMAGE_PHP_7_3_ALPINE**', example='Image'),
      packageUrl?: string(name='PackageUrl', description='The address of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PhpZip**.', example='registry-vpc.cn-hangzhou.aliyuncs.com/demo/nginx:latest'),
      packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required when the **PackageType** parameter is set to **FatJar**, **War**, or **PhpZip**. The parameter value will be automatically generated when you use an image to deploy the application and specify the **ImageUrl** parameter.', example='1.0.0'),
      replicas?: int32(name='Replicas', description='The total number of instances.', example='10'),
      runningInstances?: int32(name='RunningInstances', description='The number of running instances.', example='1'),
      webContainer?: string(name='WebContainer', description='The version of the Apache Tomcat container on which the deployment package of the application depends. This parameter is invalid when the **PackageType** parameter is set to **Image**.', example='Apache Tomcat 7'),
    }
  ](name='Data', description='The information about the instance groups of the application.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information about instance groups of an application was obtained. Valid values:

*   **true**: indicates that the information was obtained.
*   **false**: indicates that the information could not be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationGroupsResponseBody(name='body'),
}

/**
 * @param request DescribeApplicationGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationGroupsResponse
 */
async function describeApplicationGroupsWithOptions(request: DescribeApplicationGroupsRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationGroupsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationGroups',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/describeApplicationGroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeApplicationGroupsRequest
 * @return DescribeApplicationGroupsResponse
 */
async function describeApplicationGroups(request: DescribeApplicationGroupsRequest): DescribeApplicationGroupsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationGroupsWithOptions(request, headers, runtime);
}

model DescribeApplicationImageRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='d700e680-aa4d-4ec1-afc2-6566b5ff****'),
  imageUrl?: string(name='ImageUrl', description='The URL of the image.

This parameter is required.', example='registry-vpc.cn-hangzhou.aliyuncs.com/demo/demo:latest'),
}

model DescribeApplicationImageResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    crUrl?: string(name='CrUrl', description='This parameter is reserved.'),
    logo?: string(name='Logo', description='This parameter is reserved.'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
    repoName?: string(name='RepoName', description='The name of the repository.', example='demo'),
    repoNamespace?: string(name='RepoNamespace', description='The name of the namespace to which the image repository belongs.', example='demo'),
    repoOriginType?: string(name='RepoOriginType', description='The type of the repository. Only Container Registry is supported.', example='ALI_HUB'),
    repoTag?: string(name='RepoTag', description='The tag of the image.', example='latest'),
    repoType?: string(name='RepoType', description='This parameter is reserved.'),
  }(name='Data', description='The information about the image of the application.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information about the image was obtained. Valid values:

*   **true**: The information was obtained.
*   **false**: The information failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationImageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationImageResponseBody(name='body'),
}

/**
 * @summary Queries the information about the image of an application.
 *
 * @param request DescribeApplicationImageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationImageResponse
 */
async function describeApplicationImageWithOptions(request: DescribeApplicationImageRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationImageResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationImage',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/container/describeApplicationImage`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the image of an application.
 *
 * @param request DescribeApplicationImageRequest
 * @return DescribeApplicationImageResponse
 */
async function describeApplicationImage(request: DescribeApplicationImageRequest): DescribeApplicationImageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationImageWithOptions(request, headers, runtime);
}

model DescribeApplicationInstancesRequest {
  appId?: string(name='AppId', description='d700e680-aa4d-4ec1-afc2-6566b5ff\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='d700e680-aa4d-4ec1-afc2-6566b5ff****'),
  currentPage?: int32(name='CurrentPage', description='1', example='1'),
  groupId?: string(name='GroupId', description='b2a8a925-477a-4ed7-b825-d5e22500\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
  instanceId?: string(name='InstanceId'),
  pageSize?: int32(name='PageSize', description='10', example='10'),
  pipelineId?: string(name='PipelineId'),
  reverse?: boolean(name='Reverse', description='true', example='true'),
}

model DescribeApplicationInstancesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', description='The number of the returned page.', example='1'),
    instances?: [ 
      {
        createTimeStamp?: long(name='CreateTimeStamp', description='The start time of the instance creation process. Unit: milliseconds.', example='1558442609000'),
        debugStatus?: boolean(name='DebugStatus'),
        eip?: string(name='Eip', description='The elastic IP address (EIP).', example='8.129.XX.XXX'),
        finishTimeStamp?: long(name='FinishTimeStamp', description='The end time of the instance creation process. Unit: milliseconds.', example='1642757283000'),
        groupId?: string(name='GroupId', description='The ID of the group to which the instance belongs.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
        imageUrl?: string(name='ImageUrl', description='The address of the repository.

>  If you deploy the application by using a JAR or WAR package, the image generated by SAE is not available for download.', example='registry-vpc.cn-beijing.aliyuncs.com/sae-demo-image/cartservice:1.0'),
        instanceContainerIp?: string(name='InstanceContainerIp', description='The internal IP address of the instance.', example='192.168.X.X'),
        instanceContainerRestarts?: long(name='InstanceContainerRestarts', description='The number of times that the instance restarted.', example='0'),
        instanceContainerStatus?: string(name='InstanceContainerStatus', description='The state of the instance. Valid values:

*   **Error**: An error occurred during the instance startup.
*   **CrashLoopBackOff**: The container failed to start. An error occurred during the startup process and persisted after the restart.
*   **ErrImagePull**: An error occurred while the container image was being pulled from the instance.
*   **ImagePullBackOff**: The container image could not be obtained.
*   **Pending**: The instance is waiting to be scheduled.
*   **Unknown**: An unknown exception occurred.
*   **Terminating**: The instance creation process is being terminated.
*   **NotFound**: The instance cannot be found.
*   **PodInitializing**: The instance is being initialized.
*   **Init:0/1**: The instance is initialized.
*   **Running**: The instance is running.', example='Running'),
        instanceHealthStatus?: string(name='InstanceHealthStatus', description='The configurations of health checks. Valid values:

*   **WithoutHealthCheckConfig**: Liveness and readiness checks are not configured.
*   **WithoutLivenessConfig**: The liveness check is not configured.
*   **WithoutReadinessConfig**: The readiness check is not configured.
*   **NotCheckedYet**: The health checks are not performed or are in progress.
*   **LivenessUnhealthy**: The instance failed the liveness check.
*   **ReadinessUnhealthy**: The instance failed the readiness check.
*   **Unhealthy**: The instance failed both liveness and readiness checks.
*   **Healthy**: The instance passed both liveness and readiness checks.', example='WithoutHealthCheckConfig'),
        instanceId?: string(name='InstanceId', description='The ID of the instance.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
        mainContainerStatus?: string(name='MainContainerStatus'),
        packageVersion?: string(name='PackageVersion', description='The version of the package.', example='1609939496200'),
        sidecarContainersStatus?: [ 
          {
            containerId?: string(name='ContainerId'),
            containerStatus?: string(name='ContainerStatus'),
            imageUrl?: string(name='ImageUrl'),
          }
        ](name='SidecarContainersStatus'),
        timestamp?: long(name='Timestamp'),
        unhealthyMessage?: string(name='UnhealthyMessage'),
        vSwitchId?: string(name='VSwitchId', description='The ID of the zone where the instance is deployed.', example='vsw-***'),
      }
    ](name='Instances', description='The list of application instances.'),
    pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='10'),
    totalSize?: int32(name='TotalSize', description='The total number of returned instances.', example='10'),
  }(name='Data', description='The details of the application instances.'),
  errorCode?: string(name='ErrorCode', description='The error code. 

- The **ErrorCode** parameter is not returned when the request succeeds.
- The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of application instances was obtained. Valid values:

*   **true**: indicates that the list was obtained.
*   **false**: indicates that the list could not be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationInstancesResponseBody(name='body'),
}

/**
 * @summary Queries application instances.
 *
 * @param request DescribeApplicationInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationInstancesResponse
 */
async function describeApplicationInstancesWithOptions(request: DescribeApplicationInstancesRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationInstancesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.pipelineId)) {
    query['PipelineId'] = request.pipelineId;
  }
  if (!$isNull(request.reverse)) {
    query['Reverse'] = request.reverse;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationInstances',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/describeApplicationInstances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries application instances.
 *
 * @param request DescribeApplicationInstancesRequest
 * @return DescribeApplicationInstancesResponse
 */
async function describeApplicationInstances(request: DescribeApplicationInstancesRequest): DescribeApplicationInstancesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationInstancesWithOptions(request, headers, runtime);
}

model DescribeApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='a0d2e04c-159d-40a8-b240-d2f2c263\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='a0d2e04c-159d-40a8-b240-d2f2c263****'),
  scalingRuleName?: string(name='ScalingRuleName', description='test

This parameter is required.', example='test'),
}

model DescribeApplicationScalingRuleResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    appId?: string(name='AppId', description='The ID of the application.', example='a0d2e04c-159d-40a8-b240-d2f2c263****'),
    createTime?: long(name='CreateTime', description='The time when the auto scaling policy was created. Unit: milliseconds.', example='1624329843790'),
    lastDisableTime?: long(name='LastDisableTime', description='The time when the auto scaling policy was last disabled.', example='1641882854484'),
    metric?: {
      maxReplicas?: int32(name='MaxReplicas', description='The maximum number of instances.', example='3'),
      metrics?: [ 
        {
          metricTargetAverageUtilization?: int32(name='MetricTargetAverageUtilization', description='The limit on the metric.

*   The limit on the CPU utilization. Unit: percentage.
*   The limit on the memory usage. Unit: percentage.
*   The limit on the average number of active TCP connections per second.
*   The limit on the QPS of the Internet-facing SLB instance.
*   The limit on the response time of the Internet-facing SLB instance. Unit: milliseconds.', example='20'),
          metricType?: string(name='MetricType', description='The metric that is used to trigger the auto scaling policy. Valid values:

*   **CPU**: the CPU utilization.
*   **MEMORY**: the memory usage.
*   **tcpActiveConn**: the average number of active TCP connections for an instance in 30 seconds.
*   **SLB_QPS**: the average QPS of the Internet-facing SLB instance associated with an application instance in 15 seconds.
*   **SLB_RT**: the average response time of the Internet-facing SLB instance in 15 seconds.', example='CPU'),
          slbId?: string(name='SlbId', example='lb-xxx'),
          slbLogstore?: string(name='SlbLogstore', example='test'),
          slbProject?: string(name='SlbProject', example='test'),
          vport?: string(name='Vport', example='80'),
        }
      ](name='Metrics', description='The list of metrics that are used to trigger the auto scaling policy.'),
      metricsStatus?: {
        currentMetrics?: [ 
          {
            currentValue?: long(name='CurrentValue', description='The current value of the metric.', example='0'),
            name?: string(name='Name', description='The name of the metric.

*   **cpu**: the CPU utilization.
*   **memory**: the memory usage.
*   **tcpActiveConn**: the number of active TCP connections.
*   **slb_incall_qps**: the QPS of the Internet-facing SLB instance.
*   **slb_incall_rt**: the response time of the Internet-facing SLB instance.', example='cpu'),
            type?: string(name='Type', description='The type of the data. This parameter corresponds to the metric.

*   **Resource**: used when the metric is the **CPU utilization** or **memory usage**.
*   **Pods**: used when the metric is the **number of active TCP connections**.
*   **External**: used when the metric is about the **SLB** instance or from **Application Real-Time Monitoring Service (ARMS)**.', example='Resource'),
          }
        ](name='CurrentMetrics', description='The metrics that is used to trigger the current auto scaling policy.'),
        currentReplicas?: long(name='CurrentReplicas', description='The current number of instances.', example='2'),
        desiredReplicas?: long(name='DesiredReplicas', description='The expected number of instances.', example='2'),
        lastScaleTime?: string(name='LastScaleTime', description='The time when the auto scaling policy was last triggered.', example='2022-01-11T08:14:32Z'),
        nextScaleMetrics?: [ 
          {
            name?: string(name='Name', description='The name of the metric.

*   **cpu**: the CPU utilization.
*   **memory**: the memory usage.
*   **tcpActiveConn**: the number of active TCP connections.
*   **slb_incall_qps**: the QPS of the Internet-facing SLB instance.
*   **slb_incall_rt**: the response time of the Internet-facing SLB instance.', example='cpu'),
            nextScaleInAverageUtilization?: int32(name='NextScaleInAverageUtilization', description='The metric value as a percentage that triggers the application scale-in next time.', example='10'),
            nextScaleOutAverageUtilization?: int32(name='NextScaleOutAverageUtilization', description='The metric value as a percentage that triggers the application scale-out next time.', example='21'),
          }
        ](name='NextScaleMetrics', description='The metrics that are used to trigger the auto scaling policy next time.'),
        nextScaleTimePeriod?: int32(name='NextScaleTimePeriod', description='The duration for which the metric-based auto scaling policy takes effect next time.', example='3'),
      }(name='MetricsStatus', description='The execution status of the metric-based auto scaling policy.'),
      minReplicas?: int32(name='MinReplicas', description='The minimum number of instances.', example='1'),
      scaleDownRules?: {
        disabled?: boolean(name='Disabled', description='Indicates whether the application scale-in is disabled. Valid values:

*   **true**: disabled.
*   **false**: enabled.

>  When this parameter is set to true, the application instances are never reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.', example='false'),
        stabilizationWindowSeconds?: long(name='StabilizationWindowSeconds', description='The cooldown time of the scale-in. Valid values: 0 to 3600. Unit: seconds. Default value: 0.', example='300'),
        step?: long(name='Step', description='The step size for the scale-in. The maximum number of instances that can be reduced within a specific period of time.', example='100'),
      }(name='ScaleDownRules', description='Rules that determine the application scale-in.'),
      scaleUpRules?: {
        disabled?: boolean(name='Disabled', description='Indicates whether the application scale-in is disabled. Valid values:

*   **true**: The application scale-in is disabled.
*   **false**: The application scale-in is enabled.

>  When this parameter is set to true, the application instances are never reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.', example='false'),
        stabilizationWindowSeconds?: long(name='StabilizationWindowSeconds', description='The cooldown time of the scale-out. Valid values: 0 to 3600. Unit: seconds. Default value: 0.', example='300'),
        step?: long(name='Step', description='The step size for the scale-out. The maximum number of instances that can be added within a specific period of time.', example='100'),
      }(name='ScaleUpRules', description='Rules that determine the application scale-out.'),
    }(name='Metric', description='The details of the metric-based auto scaling policy.'),
    minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', example='-1'),
    minReadyInstances?: int32(name='MinReadyInstances', example='1'),
    scaleRuleEnabled?: boolean(name='ScaleRuleEnabled', description='Indicates whether the auto scaling policy is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
    scaleRuleName?: string(name='ScaleRuleName', description='The name of the auto scaling policy.', example='test'),
    scaleRuleType?: string(name='ScaleRuleType', description='The type of the auto scaling policy. Valid values:

*   **timing**: the scheduled auto scaling policy.
*   **metric**: the metric-based auto scaling policy.
*   **mix**: the hybrid auto scaling policy.', example='timing'),
    timer?: {
      beginDate?: string(name='BeginDate', description='The start date of the validity period of the scheduled auto scaling policy. Valid values:

*   If both the **BeginDate** and **EndDate** parameters are set to **null**, the auto scaling policy can always be triggered. The default value for these parameters is null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is **2021-03-25** and **EndDate** is **2021-04-25**, the auto scaling policy is valid for one month.', example='2021-03-25'),
      endDate?: string(name='EndDate', description='The end date of the validity period of the scheduled auto scaling policy. Valid values:

*   If both the **BeginDate** and **EndDate** parameters are set to **null**, the auto scaling policy can always be triggered. The default value for these parameters is null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is **2021-03-25** and **EndDate** is **2021-04-25**, the auto scaling policy is valid for one month.', example='2021-04-25'),
      period?: string(name='Period', description='The days on which the scheduled auto scaling policy takes effect. Valid values:

*   **\\\\* \\\\* \\\\***: The scheduled auto scaling policy takes effect at a specified time every day.

*   **\\\\* \\\\* Fri,Mon**: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a week. The specified time is in the GMT+8 time zone. Valid values:

    *   **Sun**: Sunday
    *   **Mon**: Monday
    *   **Tue**: Tuesday
    *   **Wed**: Wednesday
    *   **Thu**: Thursday
    *   **Fri**: Friday
    *   **Sat**: Saturday

*   **1,2,3,28,31 \\\\* \\\\***: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy takes effect on the specified days other than the 31st day.', example='* * *'),
      schedules?: [ 
        {
          atTime?: string(name='AtTime', description='The point in time. Format: **Hour:Minute**.', example='08:00'),
          maxReplicas?: int32(name='MaxReplicas', example='10'),
          minReplicas?: int32(name='MinReplicas', example='1'),
          targetReplicas?: int32(name='TargetReplicas', description='The expected number of instances.', example='2'),
        }
      ](name='Schedules', description='The points in time when the auto scaling policy is triggered within one day.'),
    }(name='Timer', description='The details of the scheduled auto scaling policy.'),
    updateTime?: long(name='UpdateTime', description='The time when the auto scaling policy was updated. Unit: milliseconds.', example='1624330075827'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='73404D3D-EE4F-4CB2-B197-5C46F6A1****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0b57ff7e16243300839193068e****'),
}

model DescribeApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @summary Queries a specified auto scaling policy of an application.
 *
 * @param request DescribeApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationScalingRuleResponse
 */
async function describeApplicationScalingRuleWithOptions(request: DescribeApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/applicationScalingRule`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a specified auto scaling policy of an application.
 *
 * @param request DescribeApplicationScalingRuleRequest
 * @return DescribeApplicationScalingRuleResponse
 */
async function describeApplicationScalingRule(request: DescribeApplicationScalingRuleRequest): DescribeApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationScalingRuleWithOptions(request, headers, runtime);
}

model DescribeApplicationScalingRulesRequest {
  appId?: string(name='AppId', description='7171a6ca-d1cd-4928-8642-7d5cfe69\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
}

model DescribeApplicationScalingRulesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    applicationScalingRules?: [ 
      {
        appId?: string(name='AppId', description='The ID of the application.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
        createTime?: long(name='CreateTime', description='The time when the auto scaling policy was created. Unit: milliseconds.', example='1616642248938'),
        lastDisableTime?: long(name='LastDisableTime', description='The time when the auto scaling policy was last disabled.', example='1641882854484'),
        metric?: {
          maxReplicas?: int32(name='MaxReplicas', description='The maximum number of instances.', example='3'),
          metrics?: [ 
            {
              metricTargetAverageUtilization?: int32(name='MetricTargetAverageUtilization', description='The limit on the metric.

*   The limit on the CPU utilization. Unit: percentage.
*   The limit on the memory usage. Unit: percentage.
*   The limit on the average number of active TCP connections per second.
*   The limit on the queries per second (QPS) of the Internet-facing Server Load Balancer (SLB) instance.
*   The limit on the response time of the Internet-facing SLB instance. Unit: milliseconds.', example='20'),
              metricType?: string(name='MetricType', description='The metric that is used to trigger the auto scaling policy. Valid values:

*   **CPU**: the CPU utilization.
*   **MEMORY**: the memory usage.
*   **tcpActiveConn**: the average number of active TCP connections per second of an application instance in 30 seconds.
*   **SLB_QPS**: the average QPS of the Internet-facing SLB instance associated with an application instance in 15 seconds.
*   **SLB_RT**: the average response time of the Internet-facing SLB instance in 15 seconds.', example='CPU'),
              slbId?: string(name='SlbId', example='lb-xxx'),
              slbLogstore?: string(name='SlbLogstore', example='test'),
              slbProject?: string(name='SlbProject', example='test'),
              vport?: string(name='Vport', example='80'),
            }
          ](name='Metrics', description='The list of metrics that are used to trigger the auto scaling policy.'),
          metricsStatus?: {
            currentMetrics?: [ 
              {
                currentValue?: long(name='CurrentValue', description='The current value of the metric.', example='0'),
                name?: string(name='Name', description='The name of the metric.

*   **cpu**: the CPU utilization.
*   **memory**: the memory usage.
*   **tcpActiveConn**: the number of active TCP connections.
*   **slb_incall_qps**: the QPS of the Internet-facing SLB instance.
*   **slb_incall_rt**: the response time of the Internet-facing SLB instance.', example='cpu'),
                type?: string(name='Type', description='The type of the data. This parameter corresponds to the metric.

*   **Resource**: used when the metric is the **CPU utilization** or **memory usage**.
*   **Pods**: used when the metric is the **number of active TCP connections**.
*   **External**: used when the metric is about the **SLB** instance or from **Application Real-Time Monitoring Service (ARMS)**.', example='Resource'),
              }
            ](name='CurrentMetrics', description='The metrics that are used to trigger the auto scaling policy this time.'),
            currentReplicas?: long(name='CurrentReplicas', description='The current number of instances.', example='2'),
            desiredReplicas?: long(name='DesiredReplicas', description='The expected number of instances.', example='2'),
            lastScaleTime?: string(name='LastScaleTime', description='The time when the auto scaling policy was last triggered.', example='2022-01-11T08:14:32Z'),
            maxReplicas?: long(name='MaxReplicas', description='The maximum number of instances.', example='3'),
            minReplicas?: long(name='MinReplicas', description='The minimum number of instances.', example='1'),
            nextScaleMetrics?: [ 
              {
                name?: string(name='Name', description='The name of the metric.

*   **cpu**: the CPU utilization.
*   **memory**: the memory usage.
*   **tcpActiveConn**: the number of active TCP connections.
*   **slb_incall_qps**: the QPS of the Internet-facing SLB instance.
*   **slb_incall_rt**: the response time of the Internet-facing SLB instance.', example='cpu'),
                nextScaleInAverageUtilization?: int32(name='NextScaleInAverageUtilization', description='The metric value as a percentage that triggers the application scale-in next time.', example='10'),
                nextScaleOutAverageUtilization?: int32(name='NextScaleOutAverageUtilization', description='The metric value as a percentage that triggers the application scale-out next time.', example='21'),
              }
            ](name='NextScaleMetrics', description='The metrics that are used to trigger the auto scaling policy next time.'),
            nextScaleTimePeriod?: int32(name='NextScaleTimePeriod', description='The duration for which the metric-based auto scaling policy takes effect next time.', example='3'),
          }(name='MetricsStatus', description='The execution status of the metric-based auto scaling policy.'),
          minReplicas?: int32(name='MinReplicas', description='The minimum number of instances.', example='1'),
          scaleDownRules?: {
            disabled?: boolean(name='Disabled', description='Indicates whether the application scale-in was disabled. Valid values:

*   **true**: The application scale-in was disabled.
*   **false**: The application scale-in was enabled.

>  When this parameter is set to true, the application instances will never be reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.', example='false'),
            stabilizationWindowSeconds?: long(name='StabilizationWindowSeconds', description='The cooldown time of the scale-in. Valid values: 0 to 3600. Unit: seconds. The default value is 0.', example='300'),
            step?: long(name='Step', description='The step size for the scale-in. The maximum number of instances that can be reduced in a unit of time.', example='100'),
          }(name='ScaleDownRules', description='Rules that determine the application scale-in.'),
          scaleUpRules?: {
            disabled?: boolean(name='Disabled', description='Indicates whether the application scale-in was disabled. Valid values:

*   **true**: The application scale-in was disabled.
*   **false**: The application scale-in was enabled.

>  When this parameter is set to true, the application instances will never be reduced. This prevents risks to your business in peak hours. By default, this parameter is set to false.', example='false'),
            stabilizationWindowSeconds?: long(name='StabilizationWindowSeconds', description='The cooldown time of the scale-out. Valid values: 0 to 3600. Unit: seconds. The default value is 0.', example='300'),
            step?: long(name='Step', description='The step size for the scale-out. The maximum number of instances that can be added in a unit of time.', example='100'),
          }(name='ScaleUpRules', description='Rules that determine the application scale-out.'),
        }(name='Metric', description='The details of the metric-based auto scaling policy.'),
        minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', example='-1'),
        minReadyInstances?: int32(name='MinReadyInstances', example='1'),
        scaleRuleEnabled?: boolean(name='ScaleRuleEnabled', description='Indicates whether the auto scaling policy is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
        scaleRuleName?: string(name='ScaleRuleName', description='The name of the auto scaling policy.', example='test'),
        scaleRuleType?: string(name='ScaleRuleType', description='The type of the auto scaling policy. Valid values:

*   **timing**: the scheduled auto scaling policy.
*   **metric**: the metric-based auto scaling policy.
*   **mix**: the hybrid auto scaling policy.', example='timing'),
        timer?: {
          beginDate?: string(name='BeginDate', description='The start date of the validity period of the scheduled auto scaling policy. Valid values:

*   If both the **BeginDate** and **EndDate** parameters are set to **null**, the auto scaling policy can always be triggered. The default value for these parameters is null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is 2021-03-25 and **EndDate** is 2021-04-25, the auto scaling policy is valid for one month.', example='2021-03-25'),
          endDate?: string(name='EndDate', description='The end date of the validity period of the scheduled auto scaling policy. Valid values:

*   If both the **BeginDate** and **EndDate** parameters are set to **null**, the auto scaling policy can always be triggered. The default value for these parameters is null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is 2021-03-25 and **EndDate** is 2021-04-25, the auto scaling policy is valid for one month.', example='2021-04-25'),
          period?: string(name='Period', description='The days on which the scheduled auto scaling policy takes effect. Valid values:

*   **\\\\* \\\\* \\\\***: The scheduled auto scaling policy takes effect at a specified time every day.

*   **\\\\* \\\\* Fri,Mon**: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a week. The specified time is in the GMT+8 time zone. Valid values:

    *   **Sun**: Sunday
    *   **Mon**: Monday
    *   **Tue**: Tuesday
    *   **Wed**: Wednesday
    *   **Thu**: Thursday
    *   **Fri**: Friday
    *   **Sat**: Saturday

*   **1,2,3,28,31 \\\\* \\\\***: The scheduled auto scaling policy takes effect at a specified time on one or multiple days of a month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy takes effect on the specified days other than the 31st day.', example='* * *'),
          schedules?: [ 
            {
              atTime?: string(name='AtTime', description='The point in time. Format: **Hour:Minute**.', example='08:00'),
              maxReplicas?: long(name='MaxReplicas', description='The maximum number of instances.', example='50'),
              minReplicas?: long(name='MinReplicas', description='The minimum number of instances.', example='1'),
              targetReplicas?: int32(name='TargetReplicas', description='The expected number of instances.', example='3'),
            }
          ](name='Schedules', description='The points in time when the auto scaling policy is triggered within one day.'),
        }(name='Timer', description='The details of the scheduled auto scaling policy.'),
        updateTime?: long(name='UpdateTime', description='The time when the auto scaling policy was updated. Unit: milliseconds.', example='1616642248938'),
      }
    ](name='ApplicationScalingRules', description='The auto scaling policies of the application.'),
    currentPage?: int32(name='CurrentPage', description='The number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='10'),
    totalSize?: int32(name='TotalSize', description='The total number of auto scaling policies.', example='3'),
  }(name='Data', description='The data returned.'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationScalingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationScalingRulesResponseBody(name='body'),
}

/**
 * @summary Queries the auto scaling policies of an application.
 *
 * @param request DescribeApplicationScalingRulesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationScalingRulesResponse
 */
async function describeApplicationScalingRulesWithOptions(request: DescribeApplicationScalingRulesRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationScalingRulesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationScalingRules',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/applicationScalingRules`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the auto scaling policies of an application.
 *
 * @param request DescribeApplicationScalingRulesRequest
 * @return DescribeApplicationScalingRulesResponse
 */
async function describeApplicationScalingRules(request: DescribeApplicationScalingRulesRequest): DescribeApplicationScalingRulesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationScalingRulesWithOptions(request, headers, runtime);
}

model DescribeApplicationSlbsRequest {
  appId?: string(name='AppId', description='The ID of the request.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
}

model DescribeApplicationSlbsResponseBody = {
  code?: string(name='Code', description='Indicates whether the information about the SLB instances that are associated with an application was obtained successfully. Valid values:

*   **true**: indicates that the information was obtained successfully.
*   **false**: indicates that the information failed to be obtained.', example='200'),
  data?: {
    internet?: [ 
      {
        cookie?: string(name='Cookie', example='wwe'),
        cookieTimeout?: int32(name='CookieTimeout', example='56'),
        createTime?: long(name='CreateTime', description='The timestamp when the canary release rule was created.', example='1741247308294'),
        httpsCaCertId?: string(name='HttpsCaCertId', example='1513561019707729_16f37aae5f3_-375882821_-169099****'),
        httpsCertId?: string(name='HttpsCertId', description='The supported protocol.', example='1513561019707729_16f37aae5f3_-375882821_-169099****'),
        port?: int32(name='Port', description='The ID of the internal-facing SLB instance.', example='80'),
        protocol?: string(name='Protocol', description='The container port.', example='TCP'),
        stickySession?: boolean(name='StickySession', example='false'),
        stickySessionType?: string(name='StickySessionType', example='insert'),
        targetPort?: int32(name='TargetPort', description='The port specified for the SLB listener.', example='8080'),
      }
    ](name='Internet', description='The configurations of the Internet-facing SLB instance.'),
    internetIp?: string(name='InternetIp', description='The ID of the Internet-facing SLB instance.', example='``59.74.**.**``'),
    internetSlbChargeType?: string(name='InternetSlbChargeType', example='PayBySpec'),
    internetSlbExpired?: boolean(name='InternetSlbExpired', example='false'),
    internetSlbId?: string(name='InternetSlbId', description='Configurations of Internet-facing SLB instances.', example='lb-uf6xc7wybefehnv45****'),
    intranet?: [ 
      {
        cookie?: string(name='Cookie', example='wwe'),
        cookieTimeout?: int32(name='CookieTimeout', example='56'),
        createTime?: long(name='CreateTime', description='The timestamp when the canary release rule was created.', example='1741247308294'),
        httpsCaCertId?: string(name='HttpsCaCertId', example='1513561019707729_16f37aae5f3_-375882821_-169099****'),
        httpsCertId?: string(name='HttpsCertId', description='The supported protocol.', example='1513561019707729_16f37aae5f3_-375882821_-169099****'),
        port?: int32(name='Port', description='The IP address of the Internet-facing SLB instance.', example='80'),
        protocol?: string(name='Protocol', description='The container port.', example='TCP'),
        stickySession?: boolean(name='StickySession', example='false'),
        stickySessionType?: string(name='StickySessionType', example='insert'),
        targetPort?: int32(name='TargetPort', description='The port specified for the SLB listener.', example='8080'),
      }
    ](name='Intranet', description='The configurations of the internal-facing SLB instance.'),
    intranetIp?: string(name='IntranetIp', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='192.168.0.0'),
    intranetSlbChargeType?: string(name='IntranetSlbChargeType', example='PayBySpec'),
    intranetSlbExpired?: boolean(name='IntranetSlbExpired', example='false'),
    intranetSlbId?: string(name='IntranetSlbId', description='The IP address of the internal-facing SLB instance.', example='lb-uf6xc7wybefehnv45****'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. It can be used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The returned data.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationSlbsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationSlbsResponseBody(name='body'),
}

/**
 * @summary 017f39b8-dfa4-4e16-a84b-1dcee4b1\\*\\*\\*\\*
 *
 * @param request DescribeApplicationSlbsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationSlbsResponse
 */
async function describeApplicationSlbsWithOptions(request: DescribeApplicationSlbsRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationSlbsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationSlbs',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/slb`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 017f39b8-dfa4-4e16-a84b-1dcee4b1\\*\\*\\*\\*
 *
 * @param request DescribeApplicationSlbsRequest
 * @return DescribeApplicationSlbsResponse
 */
async function describeApplicationSlbs(request: DescribeApplicationSlbsRequest): DescribeApplicationSlbsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationSlbsWithOptions(request, headers, runtime);
}

model DescribeApplicationStatusRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
}

model DescribeApplicationStatusResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The ID of the application.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
    armsAdvancedEnabled?: string(name='ArmsAdvancedEnabled', description='Indicates whether Application Real-Time Monitoring Service (ARMS) advanced monitoring is enabled. Valid values:

*   **true**
*   **false**', example='false'),
    armsApmInfo?: string(name='ArmsApmInfo', description='The metadata of the application in ARMS.', example='{"appId":"0099b7be-5f5b-4512-a7fc-56049ef1****","licenseKey":"d5cgdt5pu0@7303f55292a****"}'),
    createTime?: string(name='CreateTime', description='The time when the application was created.', example='1563373372746'),
    currentStatus?: string(name='CurrentStatus', description='The current status of the application. Valid values:

*   **RUNNING**
*   **STOPPED**
*   **UNKNOWN**', example='RUNNING'),
    enableAgent?: boolean(name='EnableAgent', description='Indicates whether SAE agent is enabled.

*   **true**
*   **false**', example='false'),
    fileSizeLimit?: long(name='FileSizeLimit', description='The file size limit. Unit: KB. Valid values: 0 to 10240.', example='10240'),
    lastChangeOrderId?: string(name='LastChangeOrderId', description='The ID of the latest change order that is executed. If no change orders are executed or if change orders expire, this parameter is left empty.', example='1ccc2339-fc19-49aa-bda0-1e7b8497****'),
    lastChangeOrderRunning?: boolean(name='LastChangeOrderRunning', description='Indicates whether the latest change order is being executed. Valid values:

*   **true**
*   **false**', example='false'),
    lastChangeOrderStatus?: string(name='LastChangeOrderStatus', description='The status of the latest change order. Valid values:

*   **READY**: The change order is ready.
*   **RUNNING**: The change order is being executed.
*   **SUCCESS**: The change order was executed.
*   **FAIL**: The change order failed to be executed.
*   **ABORT**: The change order is stopped.
*   **WAIT_BATCH_CONFIRM**: The change order is pending execution. You must manually confirm the release batch.
*   **AUTO_BATCH_WAIT**: The change order is pending execution. SAE will automatically confirm the release batch.
*   **SYSTEM_FAIL**: A system exception occurred.
*   **WAIT_APPROVAL**: The change order is pending approval.
*   **APPROVED**: The change order is approved and is pending execution.', example='SUCCESS'),
    runningInstances?: int32(name='RunningInstances', description='The number of running instances of the application.', example='1'),
    subStatus?: string(name='SubStatus', description='The substatus of the change order. This parameter indicates whether an exception occurred while the change order was being executed. Valid values:

*   **NORMAL**
*   **RUNNING_BUT_HAS_ERROR**: For example, if an error occurs during a phased release, you must manually roll back the application. In this case, the change order cannot be completed because the change order is still being executed.', example='NORMAL'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the status of the application was queried. Valid values:

*   **true**: The status was queried.
*   **false**: The status failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeApplicationStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicationStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of an application.
 *
 * @param request DescribeApplicationStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeApplicationStatusResponse
 */
async function describeApplicationStatusWithOptions(request: DescribeApplicationStatusRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeApplicationStatusResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeApplicationStatus',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/describeApplicationStatus`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of an application.
 *
 * @param request DescribeApplicationStatusRequest
 * @return DescribeApplicationStatusResponse
 */
async function describeApplicationStatus(request: DescribeApplicationStatusRequest): DescribeApplicationStatusResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeApplicationStatusWithOptions(request, headers, runtime);
}

model DescribeChangeOrderRequest {
  changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. You can call the [ListChangeOrders](https://help.aliyun.com/document_detail/126615.html) operation to obtain the ID.

This parameter is required.', example='76fa5c0-9ebb-4bb4-b383-1f885447****'),
}

model DescribeChangeOrderResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The ID of the application.', example='bbbbb-3fd370b2-3646-4ba6-91f9-9423e19ab0cd-*****'),
    appName?: string(name='AppName', description='The name of the application.', example='app-test'),
    approvalId?: string(name='ApprovalId', description='The approval ID of the change order.', example='67de0b39-a9d4-4c09-a170-cf438208****'),
    auto?: boolean(name='Auto', description='Indicates whether SAE automatically releases the batches. Valid values:

*   **true**: SAE automatically releases the batches.
*   **false**: SAE does not automatically release the batches.', example='true'),
    batchCount?: int32(name='BatchCount', description='The number of release batches.', example='1'),
    batchType?: string(name='BatchType', description='The processing method for the batches. Valid values:

*   **auto**: SAE automatically releases the batches.
*   **Manual**: You must manually release the batches.', example='auto'),
    batchWaitTime?: int32(name='BatchWaitTime', description='The interval between batches in a phased release. SAE automatically releases batches at the specified interval. Unit: minutes.', example='0'),
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='765fa5c0-9ebb-4bb4-b383-1f885447**'),
    coType?: string(name='CoType', description='The change type, which corresponds to the **CoTypeCode** parameter.'),
    coTypeCode?: string(name='CoTypeCode', description='The code of the change type. Valid values:

*   **CoBindSlb**: associates a Sever Load Balancer (SLB) instance with the application.
*   **CoUnbindSlb**: disassociates the SLB instance from the application.
*   **CoCreateApp**: creates the application.
*   **CoDeleteApp**: deletes the application.
*   **CoDeploy**: deploys the application.
*   **CoRestartApplication**: restarts the application.
*   **CoRollback**: rolls back the application.
*   **CoScaleIn**: scales in the application.
*   **CoScaleOut**: scales out the application.
*   **CoStart**: starts the application.
*   **CoStop**: stops the application.
*   **CoRescaleApplicationVertically**: modifies the instance type.
*   **CoDeployHistroy**: rolls back the application to a historical version.
*   **CoBindNas**: associates a NAS file system with the application.
*   **CoUnbindNas**: disassociates the NAS file system from the application.
*   **CoBatchStartApplication**: starts multiple applications concurrently.
*   **CoBatchStopApplication**: stops multiple applications concurrently.
*   **CoRestartInstances**: restarts the instances.
*   **CoDeleteInstances**: deletes the instances.
*   **CoScaleInAppWithInstances**: reduces the specified number of application instances.', example='CoRestartInstances'),
    createTime?: string(name='CreateTime', description='The time when the change order was created.', example='2020-12-17 21:06:45'),
    currentPipelineId?: string(name='CurrentPipelineId', description='The ID of the current batch.', example='0e4acf82-c9b1-4c1e-ac28-55776338****'),
    description?: string(name='Description', description='The description of the change order.', example='description'),
    errorMessage?: string(name='ErrorMessage', description='The error message.', example='success'),
    pipelines?: [ 
      {
        batchType?: int32(name='BatchType', description='The batch type.', example='0'),
        parallelCount?: int32(name='ParallelCount', description='The number of parallel tasks in a batch.', example='0'),
        pipelineId?: string(name='PipelineId', description='The ID of the batch.', example='0e4acf82-c9b1-4c1e-ac28-55776338****'),
        pipelineName?: string(name='PipelineName', description='The name of the batch.', example='Batch 1 Change'),
        startTime?: long(name='StartTime', description='The time when the batch processing started.', example='1562831689704'),
        status?: int32(name='Status', description='The status of the batch. Valid values:

*   **0**: The batch is being prepared.
*   **1**: The batch is being processed.
*   **2**: The batch was processed.
*   **3**: The batch failed to be processed.
*   **6**: The batch processing was terminated.
*   **8**: The execution process is pending. You must manually release the batch.
*   **9**: The execution process is pending. SAE will automatically release the batch.
*   **10**: The batch failed to be processed due to a system exception.
*   **11**: The batch is pending approval.
*   **12**: The batch is approved and is pending execution.', example='2'),
        updateTime?: long(name='UpdateTime', description='The time when the batch information was last modified.', example='1562847178007'),
      }
    ](name='Pipelines', description='The batch information.'),
    status?: int32(name='Status', description='The status of the change order. Valid values:

*   **0**: The change order is being prepared.
*   **1**: The change order is being executed.
*   **2**: The change order was executed.
*   **3**: The change order failed to be executed.
*   **6**: The change order was terminated.
*   **8**: The execution process is pending. You must manually release the batches.
*   **9**: The execution process is pending. SAE will automatically release the batches.
*   **10**: The execution failed due to a system exception.
*   **11**: The change order is pending approval.
*   **12**: The change order is approved and is pending execution.', example='2'),
    subStatus?: int32(name='SubStatus', description='The substatus of the change order. This parameter indicates whether an exception occurred while the change order was being executed. Valid values:

*   **0**: No exception occurred.
*   **1**: An exception occurred. For example, if an error occurs during a phased release, you must manually roll back the application. In this case, the change order cannot be completed, so the Status parameter is still displayed as "1", which indicates that the change order is being executed. You can check the value of this parameter to determine whether an exception occurs.', example='0'),
    supportRollback?: boolean(name='SupportRollback', description='Indicates whether the application can be rolled back. Valid values:

*   **true**: The application can be rolled back.
*   **false**: The application cannot be rolled back.', example='false'),
  }(name='Data', description='The details of the change order.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeChangeOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeChangeOrderResponseBody(name='body'),
}

/**
 * @summary Queries the information of a change order.
 *
 * @param request DescribeChangeOrderRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeChangeOrderResponse
 */
async function describeChangeOrderWithOptions(request: DescribeChangeOrderRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeChangeOrderResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.changeOrderId)) {
    query['ChangeOrderId'] = request.changeOrderId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeChangeOrder',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/DescribeChangeOrder`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information of a change order.
 *
 * @param request DescribeChangeOrderRequest
 * @return DescribeChangeOrderResponse
 */
async function describeChangeOrder(request: DescribeChangeOrderRequest): DescribeChangeOrderResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeChangeOrderWithOptions(request, headers, runtime);
}

model DescribeComponentsRequest {
  appId?: string(name='AppId', description='The application ID.', example='d700e680-aa4d-4ec1-afc2-6566b5ff****'),
  type?: string(name='Type', description='The type of the supported components. Valid values:

*   **TOMCAT**
*   **JDK**

This parameter is required.', example='TOMCAT'),
}

model DescribeComponentsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      componentDescription?: string(name='ComponentDescription', description='The description of the component.', example='Open JDK 8'),
      componentKey?: string(name='ComponentKey', description='The component ID.', example='Open JDK 8'),
      expired?: boolean(name='Expired', description='Indicates whether the component is expired. Valid values:

*   **true**: The component is expired.
*   **false**: The component is not expired.', example='false'),
      type?: string(name='Type', description='The type of the component.', example='JDK'),
    }
  ](name='Data', description='The details of the supported components.'),
  errorCode?: string(name='ErrorCode', description='The status code. Valid values:

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** section of this topic.'),
  message?: string(name='Message', description='The message returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the component version was obtained. Valid values:

*   **true**: The applications were obtained.
*   **false**: The applications failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DescribeComponentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeComponentsResponseBody(name='body'),
}

/**
 * @summary Queries the version of the component that is required when you create and deploy an application.
 *
 * @param request DescribeComponentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeComponentsResponse
 */
async function describeComponentsWithOptions(request: DescribeComponentsRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeComponentsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeComponents',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/resource/components`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the version of the component that is required when you create and deploy an application.
 *
 * @param request DescribeComponentsRequest
 * @return DescribeComponentsResponse
 */
async function describeComponents(request: DescribeComponentsRequest): DescribeComponentsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeComponentsWithOptions(request, headers, runtime);
}

model DescribeConfigMapRequest {
  configMapId?: long(name='ConfigMapId', description='The ID of the ConfigMap whose details you want to query. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID of a ConfigMap.

This parameter is required.', example='1'),
}

model DescribeConfigMapResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    configMapId?: long(name='ConfigMapId', description='The ID of the ConfigMap.', example='1'),
    createTime?: long(name='CreateTime', description='The time when the ConfigMap was created.', example='1593746835111'),
    data?: map[string]any(name='Data', description='The key-value pairs of the ConfigMap. Format:

{"k1":"v1", "k2":"v2"}

k specifies a key and v specifies a value. For more information, see [Manage a Kubernetes ConfigMap](https://help.aliyun.com/document_detail/171326.html).', example='{"k1":"v1","k2":"v2"}'),
    description?: string(name='Description', description='The description of the ConfigMap.', example='test-desc'),
    name?: string(name='Name', description='The name of the ConfigMap.', example='test-configmap'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-hangzhou'),
    relateApps?: [ 
      {
        appId?: string(name='AppId', description='The ID of the application.', example='f16b4000-9058-4c22-a49d-49a28f0b****'),
        appName?: string(name='AppName', description='The name of the application.', example='test-app'),
      }
    ](name='RelateApps', description='The application that is associated with the ConfigMap.'),
    updateTime?: long(name='UpdateTime', description='The time when the ConfigMap was updated.', example='1593747274195'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the details of the ConfigMap were queried. Valid values:

*   **true**: The details were queried.
*   **false**: The details failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeConfigMapResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeConfigMapResponseBody(name='body'),
}

/**
 * @summary Queries the details of a ConfigMap.
 *
 * @param request DescribeConfigMapRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeConfigMapResponse
 */
async function describeConfigMapWithOptions(request: DescribeConfigMapRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeConfigMapResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.configMapId)) {
    query['ConfigMapId'] = request.configMapId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeConfigMap',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/configmap/configMap`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a ConfigMap.
 *
 * @param request DescribeConfigMapRequest
 * @return DescribeConfigMapResponse
 */
async function describeConfigMap(request: DescribeConfigMapRequest): DescribeConfigMapResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigMapWithOptions(request, headers, runtime);
}

model DescribeConfigurationPriceRequest {
  cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. This parameter cannot be set to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **12000**
*   **16000**
*   **32000**

This parameter is required.', example='2000'),
  memory?: int32(name='Memory', description='The memory size that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 2000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8,000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24576** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.

This parameter is required.', example='4096'),
  newSaeVersion?: string(name='NewSaeVersion'),
  resourceType?: string(name='ResourceType'),
  workload?: string(name='Workload', description='Scenarios:

*   Web
*   micro_service', example='Web'),
}

model DescribeConfigurationPriceResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    bagUsage?: {
      cpu?: float(name='Cpu', description='The available CPU capacity. Unit: cores \\\\*.', example='497570.450009'),
      cu?: float(name='Cu'),
      mem?: float(name='Mem', description='The available memory size. Unit: GiB ×.', example='989802.563546'),
    }(name='BagUsage', description='The remaining capacity of the resource plan.'),
    cpuMemPrice?: {
      order?: {
        discountAmount?: float(name='DiscountAmount', description='The discount amount.', example='0.0009259'),
        originalAmount?: float(name='OriginalAmount', description='The original price.', example='0.0046296'),
        ruleIds?: [ string ](name='RuleIds', description='The ID of the discount rule.'),
        tradeAmount?: float(name='TradeAmount', description='The final price of the order.', example='0.0037037'),
      }(name='Order', description='The information about pricing.'),
      rules?: [ 
        {
          name?: string(name='Name', description='The name of discount rule.'),
          ruleDescId?: float(name='RuleDescId', description='The ID of the discount rule.', example='2000010******'),
        }
      ](name='Rules', description='The discount rules.'),
    }(name='CpuMemPrice', description='The price of CPU and memory.'),
    order?: {
      discountAmount?: float(name='DiscountAmount', description='The discount amount.', example='0.0018518'),
      originalAmount?: float(name='OriginalAmount', description='The original price of the order.', example='0.0092592'),
      ruleIds?: [ string ](name='RuleIds', description='The ID of the promotion rule.'),
      tradeAmount?: float(name='TradeAmount', description='The transaction price.', example='0.0074074'),
    }(name='Order', description='The information about pricing.'),
    requestPrice?: {
      order?: {
        discountAmount?: float(name='DiscountAmount', description='The discount amount.', example='0.0009259'),
        originalAmount?: float(name='OriginalAmount', description='The original price of the order.', example='0.0046296'),
        ruleIds?: [ string ](name='RuleIds', description='The ID of the discount rule.'),
        tradeAmount?: float(name='TradeAmount', description='The actual price of the order.', example='0.0037037'),
      }(name='Order', description='The information about pricing.'),
      rules?: [ 
        {
          name?: string(name='Name', description='The name of the discount rule.'),
          ruleDescId?: long(name='RuleDescId', description='The ID of the discount policy.', example='2000010******'),
        }
      ](name='Rules', description='The discount rule.'),
    }(name='RequestPrice', description='The price based on the number of requests.'),
    rules?: [ 
      {
        name?: string(name='Name', description='The name of the promotion rule.'),
        ruleDescId?: long(name='RuleDescId', description='The ID of the promotion rule.', example='2000010******'),
      }
    ](name='Rules', description='The promotion rules.'),
    trafficPrice?: {
      order?: {
        discountAmount?: float(name='DiscountAmount', description='The discount amount.', example='0.0009259'),
        originalAmount?: float(name='OriginalAmount', description='The original price of the order.', example='0.0046296'),
        ruleIds?: [ string ](name='RuleIds', description='The ID of the discount rule.'),
        tradeAmount?: float(name='TradeAmount', description='The final price of the order.', example='0.0037037'),
      }(name='Order', description='The information about pricing.'),
      rules?: [ 
        {
          name?: string(name='Name', description='The name of the discount rule.'),
          ruleDescId?: float(name='RuleDescId', description='The ID of the discount rule.', example='2000010******'),
        }
      ](name='Rules', description='The discount rule.'),
    }(name='TrafficPrice', description='The traffic price.'),
  }(name='Data', description='The price.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   If the request was successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ADCEC067-86AD-19E2-BD43-E83F3841****'),
  success?: boolean(name='Success', description='Indicates whether the configuration price was obtained.

*   **true**: The price was obtained.
*   **false**: The price failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace.', example='1a0dcc771722848598056771******'),
}

model DescribeConfigurationPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeConfigurationPriceResponseBody(name='body'),
}

/**
 * @summary Query configuration price.
 *
 * @param request DescribeConfigurationPriceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeConfigurationPriceResponse
 */
async function describeConfigurationPriceWithOptions(request: DescribeConfigurationPriceRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeConfigurationPriceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!$isNull(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!$isNull(request.newSaeVersion)) {
    query['NewSaeVersion'] = request.newSaeVersion;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.workload)) {
    query['Workload'] = request.workload;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeConfigurationPrice',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/configurationPrice`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query configuration price.
 *
 * @param request DescribeConfigurationPriceRequest
 * @return DescribeConfigurationPriceResponse
 */
async function describeConfigurationPrice(request: DescribeConfigurationPriceRequest): DescribeConfigurationPriceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeConfigurationPriceWithOptions(request, headers, runtime);
}

model DescribeEdasContainersResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      disabled?: boolean(name='Disabled', description='Indicates whether the component is disabled. Valid values:

*   **true**: The component is disabled.
*   **false**: The component is not disabled.', example='false'),
      edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application that is developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
    }
  ](name='Data', description='The components.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of container components of a microservices application was obtained. Valid values:

*   **true**: The list was obtained.
*   **false**: The list failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeEdasContainersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEdasContainersResponseBody(name='body'),
}

/**
 * @summary Queries the container components of a microservices application.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEdasContainersResponse
 */
async function describeEdasContainersWithOptions(headers: map[string]string, runtime: $RuntimeOptions): DescribeEdasContainersResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEdasContainers',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/resource/edasContainers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the container components of a microservices application.
 *
 * @return DescribeEdasContainersResponse
 */
async function describeEdasContainers(): DescribeEdasContainersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeEdasContainersWithOptions(headers, runtime);
}

model DescribeGreyTagRouteRequest {
  greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule.

This parameter is required.', example='1'),
}

model DescribeGreyTagRouteResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    albRules?: [ 
      {
        condition?: string(name='condition', description='The condition mode of the canary release rule. Valid value: AND. This value indicates that that all conditions must be met.', example='AND'),
        ingressId?: string(name='ingressId', description='The ID of the gateway routing rule.', example='23'),
        items?: [ 
          {
            cond?: string(name='cond', description='Valid value: ==.', example='=='),
            expr?: string(name='expr', description='This parameter is not returned for applications that are associated with ALB instances.', example='N/A'),
            index?: int32(name='index', description='This parameter is not returned for applications that are associated with Application Load Balancer (ALB) instances.', example='N/A'),
            name?: string(name='name', description='The name of the parameter.', example='example'),
            operator?: string(name='operator', description='The operator. Valid value: **rawvalue**. This value indicates direct comparison.', example='rawvalue'),
            type?: string(name='type', description='The type of the comparison. Valid values:

*   **sourceIp**: SourceIp
*   **cookie**: cookie
*   **header**: header', example='cookie'),
            value?: string(name='value', description='The value of the parameter. This value is compared with the value that is obtained based on the type and name parameters.', example='test'),
          }
        ](name='items'),
        serviceId?: string(name='serviceId', description='The service ID.', example='22'),
      }
    ](name='AlbRules'),
    appId?: string(name='AppId', description='The ID of the application.', example='3faaf993-7aed-4bcd-b189-625e6a5a****'),
    createTime?: long(name='CreateTime', description='The timestamp when the canary release rule was created. Unit: milliseconds.', example='1619007592013'),
    description?: string(name='Description', description='The description of the canary release rule.', example='test'),
    dubboRules?: [ 
      {
        condition?: string(name='condition', description='The relationship between the conditions in the canary release rule. Valid values:

*   **AND**: The conditions are in the logical AND relation. All conditions must be met at the same time.
*   **OR**: The conditions are in the logical OR relation. At least one of the conditions must be met.', example='OR'),
        group?: string(name='group', description='The group of the Dubbo service that corresponds to the canary release rule.', example='DUBBO'),
        items?: [ 
          {
            cond?: string(name='cond', description='The comparison operator. Valid values: **>**, **<**, **>=**, **<=**, **==**, and **! =**.', example='=='),
            expr?: string(name='expr', description='The expression that is used to obtain the value of the parameter. Valid values:

*   **Empty**: obtains the value of the parameter.
*   **.name**: obtains the name property of the parameter. This expression works the same way as args0.getName().
*   **.isEnabled()**: obtains the enabled property of the parameter. This expression works the same way as args0.isEnabled().
*   **[0]**: indicates that the value of the parameter is an array and obtains the first value of the array. This expression works the same way as args0[0]. This expression does not start with a period (.).
*   **.get(0)**: indicates that the value of the parameter is a list and obtains the first value of the list. This expression works the same way as args0.get(0).
*   **.get("key")**: indicates that the value of the parameter is a map and obtains the value of the key in the map. This expression works the same way as args0.get("key").', example='.name'),
            index?: int32(name='index', description='The index of the parameter. The value 0 indicates the first parameter.', example='0'),
            name?: string(name='name', description='This parameter is not returned for Dubbo services.', example='N/A'),
            operator?: string(name='operator', description='The operator. Valid values:

*   **rawvalue**: direct comparison.
*   **list**: whitelist.
*   **mod**: mods 100.
*   **deterministic_proportional_steaming_division**: percentage.', example='rawvalue'),
            type?: string(name='type', description='This parameter is not returned for Dubbo services.', example='N/A'),
            value?: string(name='value', description='The value of the parameter. This value is compared with the value that is obtained based on the **expr** and **index** parameters.', example='test'),
          }
        ](name='items', description='The conditions.'),
        methodName?: string(name='methodName', description='The method name of the Dubbo service.', example='echo'),
        serviceName?: string(name='serviceName', description='The name of the Dubbo service.', example='com.alibaba.edas.boot.EchoService'),
        version?: string(name='version', description='The version of the Dubbo service.', example='1.0.0'),
      }
    ](name='DubboRules', description='The canary release rule of the Dubbo service.'),
    greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule. The ID is globally unique.', example='16'),
    name?: string(name='Name', description='The name of the canary release rule.', example='rule-name'),
    scRules?: [ 
      {
        condition?: string(name='condition', description='The relationship between the conditions in the canary release rule. Valid values:

*   **AND**: The conditions are in the logical AND relation. All conditions must be met at the same time.
*   **OR**: The conditions are in the logical OR relation. At least one of the conditions must be met.', example='OR'),
        items?: [ 
          {
            cond?: string(name='cond', description='The comparison operator. Valid values: **>**, **<**, **>=**, **<=**, **==**, and **! =**.', example='=='),
            expr?: string(name='expr', description='This parameter is not returned for Spring Cloud applications.', example='N/A'),
            index?: int32(name='index', description='This parameter is not returned for Spring Cloud applications.', example='N/A'),
            name?: string(name='name', description='The name of the parameter.', example='test'),
            operator?: string(name='operator', description='The operator. Valid values:

*   **rawvalue**: direct comparison.
*   **list**: whitelist.
*   **mod**: mods 100.
*   **deterministic_proportional_steaming_division**: percentage.', example='rawvalue'),
            type?: string(name='type', description='The type of the comparison. Valid values:

*   **param**: parameter
*   **cookie**: cookie
*   **header**: header', example='cookie'),
            value?: string(name='value', description='The value of the parameter. This value is compared with the value that is obtained based on the **type** and **name** parameters.', example='test'),
          }
        ](name='items', description='The conditions.'),
        path?: string(name='path', description='The path of the canary release rule of the Spring Cloud application.', example='/path'),
      }
    ](name='ScRules', description='The canary release rule of the Spring Cloud application.'),
    updateTime?: long(name='UpdateTime', description='The timestamp when the canary release rule was updated. Unit: milliseconds.', example='1609434061000'),
  }(name='Data', description='The information about the canary release rule.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='9D29CBD0-45D3-410B-9826-52F86F90****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeGreyTagRouteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGreyTagRouteResponseBody(name='body'),
}

/**
 * @summary Queries the details of a canary release rule based on the specified rule ID.
 *
 * @param request DescribeGreyTagRouteRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGreyTagRouteResponse
 */
async function describeGreyTagRouteWithOptions(request: DescribeGreyTagRouteRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeGreyTagRouteResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.greyTagRouteId)) {
    query['GreyTagRouteId'] = request.greyTagRouteId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeGreyTagRoute',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/tagroute/greyTagRoute`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a canary release rule based on the specified rule ID.
 *
 * @param request DescribeGreyTagRouteRequest
 * @return DescribeGreyTagRouteResponse
 */
async function describeGreyTagRoute(request: DescribeGreyTagRouteRequest): DescribeGreyTagRouteResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeGreyTagRouteWithOptions(request, headers, runtime);
}

model DescribeIngressRequest {
  ingressId?: long(name='IngressId', description='The ID of the routing rule to be queried.

This parameter is required.', example='87'),
}

model DescribeIngressResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    certId?: string(name='CertId', description='The ID of the certificate that is associated with a Classic Load Balancer (**CLB**) instance.', example='13623****809_16cad216b32_845_-419427029'),
    certIds?: string(name='CertIds', description='The ID of the certificate that is associated with an Application Load Balancer **ALB** instance.', example='87***35-cn-hangzhou,812***3-cn-hangzhou'),
    corsConfig?: {
      allowCredentials?: string(name='AllowCredentials'),
      allowHeaders?: string(name='AllowHeaders'),
      allowMethods?: string(name='AllowMethods'),
      allowOrigin?: string(name='AllowOrigin'),
      enable?: string(name='Enable'),
      exposeHeaders?: string(name='ExposeHeaders'),
      maxAge?: string(name='MaxAge'),
    }(name='CorsConfig'),
    createdBySae?: boolean(name='CreatedBySae'),
    defaultRule?: {
      appId?: string(name='AppId', description='The ID of the application that is specified in the default rule.', example='395b60e4-0550-458d-9c54-a265d036****'),
      appName?: string(name='AppName', description='The name of the application that is specified in the default rule.', example='app1'),
      backendProtocol?: string(name='BackendProtocol', description='The backend protocol. Valid values:

*   **http**: HTTP is suitable for applications that need to identify the transmitted data.
*   **https**: HTTP is suitable for applications that require encrypted data transmission.
*   **grpc**: GRPC is suitable for load balancing scenarios in which you want to deploy services in multi-language frameworks, such as the .NET framework.

This parameter is returned only if the**LoadBalanceType** parameter is set to **ALB** and the **ListenerProtocol** parameter **is set to HTTPS**.', example='HTTP'),
      containerPort?: int32(name='ContainerPort', description='The container port of the application that is specified in the default rule.', example='8080'),
    }(name='DefaultRule', description='The default rule.'),
    description?: string(name='Description', description='The name of a routing rule.', example='ingress-sae-test'),
    enableXForwardedFor?: boolean(name='EnableXForwardedFor'),
    enableXForwardedForClientSrcPort?: boolean(name='EnableXForwardedForClientSrcPort'),
    enableXForwardedForProto?: boolean(name='EnableXForwardedForProto'),
    enableXForwardedForSlbId?: boolean(name='EnableXForwardedForSlbId'),
    enableXForwardedForSlbPort?: boolean(name='EnableXForwardedForSlbPort'),
    id?: long(name='Id', description='The ID of a routing rule.', example='87'),
    idleTimeout?: int32(name='IdleTimeout', example='3'),
    listenerPort?: int32(name='ListenerPort', description='The listener ports for an SLB instance.', example='443'),
    listenerProtocol?: string(name='ListenerProtocol', description='The protocol used to forward requests. Valid values:

*   **HTTP**: HTTP is suitable for applications that need to identify the transmitted data.
*   **HTTPS**: HTTPS is suitable for applications that require encrypted data transmission.

This parameter is optional in the **CreateIngress** and **UpadateIngress** operations. If you do not configure this parameter when you call the CreateIngress or UpdateIngress operation to create or update a gateway routing rule, this parameter is not returned for the corresponding response.', example='HTTP'),
    loadBalanceType?: string(name='LoadBalanceType', description='The type of SLB instances. Valid values:

*   **clb**: Classic Load Balancer (formerly known as SLB).
*   **alb**: Application Load Balancer.', example='clb'),
    name?: string(name='Name', description='The name of a routing rule.', example='lb-uf6jt0nu4z6ior943****-80-f5****'),
    namespaceId?: string(name='NamespaceId', description='The ID of a namespace.', example='cn-beijing:sae-test'),
    requestTimeout?: int32(name='RequestTimeout', example='60'),
    rules?: [ 
      {
        appId?: string(name='AppId', description='The ID of the application specified in the forwarding rule.', example='395b60e4-0550-458d-9c54-a265d036****'),
        appName?: string(name='AppName', description='The name of the application specified in the forwarding rules.', example='app1'),
        backendProtocol?: string(name='BackendProtocol', description='The backend protocol. Valid values:

*   **http**: HTTP is suitable for applications that need to identify the transmitted data.
*   **https**: HTTPS is suitable for applications that require encrypted data transmission.
*   **grpc**: GRPC is suitable for load balancing scenarios in which you want to deploy services in multi-language frameworks, such as the .NET framework.

This parameter is returned only if the **LoadBalanceType** parameter is set to **ALB** and the **ListenerProtocol** parameter is set to **HTTPS**.', example='HTTP'),
        containerPort?: int32(name='ContainerPort', description='Tthe container port of the application specified in the forwarding rules.', example='8080'),
        domain?: string(name='Domain', description='The domain name of the application specified in the forwarding rules.', example='edas.site'),
        path?: string(name='Path', description='The path of a URL.', example='/path1'),
        rewritePath?: string(name='RewritePath', description='The path that is used to rewrite the original path.', example='/${1}'),
        ruleActions?: [ 
          {
            actionConfig?: string(name='ActionConfig'),
            actionType?: string(name='ActionType'),
          }
        ](name='RuleActions'),
      }
    ](name='Rules', description='The forwarding rules.'),
    securityPolicyId?: string(name='SecurityPolicyId', example='sp-n0kn923****'),
    slbId?: string(name='SlbId', description='The ID of a Server Load Balancer (SLB) instance.', example='lb-uf62****6d13tq2u5'),
    slbType?: string(name='SlbType', description='The type of an SLB instance. Valid values:

*   **internet**: an Internet-facing SLB instance
*   **intranet**: an Intranet-facing SLB instance', example='internet'),
  }(name='Data', description='The result returned.'),
  errorCode?: string(name='ErrorCode', description='The error codes. Valid values:

*   **ErrorCode** is not returned if a request is successful.
*   **ErrorCode** is returned if a request failed. For more information, see **Error code** section of this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   **success** is returned when a request is successful.
*   An error code is returned when the request failed.', example='success'),
  requestId?: string(name='RequestId', description='The ID of a request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the configurations of Ingresses were queried successfully. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of a trace. The ID is used to query the details of a request.', example='0a981dd515966966104121683d****'),
}

model DescribeIngressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIngressResponseBody(name='body'),
}

/**
 * @summary Call the DescribeIngress operation to query the details of an Ingress.
 *
 * @param request DescribeIngressRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIngressResponse
 */
async function describeIngressWithOptions(request: DescribeIngressRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeIngressResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.ingressId)) {
    query['IngressId'] = request.ingressId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeIngress',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/ingress/Ingress`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Call the DescribeIngress operation to query the details of an Ingress.
 *
 * @param request DescribeIngressRequest
 * @return DescribeIngressResponse
 */
async function describeIngress(request: DescribeIngressRequest): DescribeIngressResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeIngressWithOptions(request, headers, runtime);
}

model DescribeInstanceLogRequest {
  containerId?: string(name='ContainerId'),
  instanceId?: string(name='InstanceId', description='The ID of the request.

This parameter is required.', example='******-d700e680-aa4d-4ec1-afc2-6566b5ff4d7a-85d44d4bfc-*****'),
}

model DescribeInstanceLogResponseBody = {
  code?: string(name='Code', description='Indicates whether the log of the instance was obtained. Valid values:

*   **true**: indicates that the log was obtained.
*   **false**: indicates that the log could not be obtained.', example='200'),
  data?: string(name='Data', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='hello\\\\nsae\\\\n'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The log of the instance.', example='0a98a02315955564772843261e****'),
}

model DescribeInstanceLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceLogResponseBody(name='body'),
}

/**
 * @param request DescribeInstanceLogRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceLogResponse
 */
async function describeInstanceLogWithOptions(request: DescribeInstanceLogRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeInstanceLogResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.containerId)) {
    query['ContainerId'] = request.containerId;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceLog',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/instance/describeInstanceLog`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeInstanceLogRequest
 * @return DescribeInstanceLogResponse
 */
async function describeInstanceLog(request: DescribeInstanceLogRequest): DescribeInstanceLogResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeInstanceLogWithOptions(request, headers, runtime);
}

model DescribeInstanceSpecificationsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      cpu?: int32(name='Cpu', description='The CPU specification of the instance type. Unit: millicore.', example='2000'),
      enable?: boolean(name='Enable', description='Indicates whether the instance type is available. Valid values:

*   **true**
*   **false**', example='true'),
      id?: int32(name='Id', description='The ID of the instance type.', example='4'),
      memory?: int32(name='Memory', description='The memory size of the instance type. Unit: MB.', example='4096'),
      specInfo?: string(name='SpecInfo', description='The name of the instance type.'),
      version?: int32(name='Version', description='The version number of the instance type.', example='0'),
    }
  ](name='Data', description='The information about the instance types.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the instance types were queried. Valid values:

*   **true**: The instance types were queried.
*   **false**: The instance types failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeInstanceSpecificationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceSpecificationsResponseBody(name='body'),
}

/**
 * @summary Queries all instance types.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceSpecificationsResponse
 */
async function describeInstanceSpecificationsWithOptions(headers: map[string]string, runtime: $RuntimeOptions): DescribeInstanceSpecificationsResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeInstanceSpecifications',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/quota/instanceSpecifications`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries all instance types.
 *
 * @return DescribeInstanceSpecificationsResponse
 */
async function describeInstanceSpecifications(): DescribeInstanceSpecificationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeInstanceSpecificationsWithOptions(headers, runtime);
}

model DescribeJobRequest {
  appId?: string(name='AppId', description='The ID of the job template.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  jobId?: string(name='JobId', description='The job ID.', example='event-b798157b-40a2-4388-b578-71fb897103**-**'),
}

model DescribeJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the RAM role that is used to pull images across accounts. For more information, see [Pull images across Alibaba Cloud accounts](https://help.aliyun.com/document_detail/190675.html) and [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
    acrInstanceId?: string(name='AcrInstanceId', description='The ID of the Container Registry Enterprise Edition instance.', example='cri-xxxxxx'),
    appDescription?: string(name='AppDescription', description='The description of the job template.', example='Sample application'),
    appId?: string(name='AppId', description='The ID of the job template.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    appName?: string(name='AppName', description='The name of the job template.', example='demo-app'),
    backoffLimit?: long(name='BackoffLimit', description='The number of times that the job was retried.', example='3'),
    command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Example:

    command:
          - echo
          - abc
          - >
          - file0

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
    commandArgs?: string(name='CommandArgs', description='The arguments of the image startup command. This parameter contains the arguments that are required for **Command**. Format:

`["a","b"]`

In the preceding **Command** example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. If this parameter does not exist in the Command parameter, you do not need to configure it.', example='["a","b"]'),
    concurrencyPolicy?: string(name='ConcurrencyPolicy', description='The concurrency policy of the job. Valid values:

*   **Forbid**: Concurrent running is prohibited. If the previous job is not completed, no new job is created.
*   **Allow**: Concurrent running is allowed.
*   **Replace**: If the previous job is not completed when the time to create a new job is reached, the new job replaces the previous job.', example='Allow'),
    configMapMountDesc?: [ 
      {
        configMapId?: long(name='ConfigMapId', description='The ConfigMap ID.', example='1'),
        configMapName?: string(name='ConfigMapName', description='The ConfigMap name.', example='test'),
        key?: string(name='Key', description='The key-value pair that is stored in the ConfigMap.', example='k1'),
        mountPath?: string(name='MountPath', description='The path on which the ConfigMap is mounted.', example='/tmp'),
      }
    ](name='ConfigMapMountDesc', description='The details of the ConfigMap.'),
    cpu?: int32(name='Cpu', description='The CPU specifications required for each instance. Unit: millicore. This parameter cannot be set to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **16000**
*   **32000**', example='1000'),
    customHostAlias?: string(name='CustomHostAlias', description='The custom mapping between the hostname and IP address in the container. Valid values:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"test.host.name","ip":"0.0.0.0"}]'),
    edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which a job that is developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
    envs?: string(name='Envs', description='The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see [CreateConfigMap](https://help.aliyun.com/document_detail/176914.html). Valid values:

*   Custom configuration

    *   **name**: the name of the environment variable.
    *   **value**: the value of the environment variable.

*   Reference a ConfigMap

    *   **name**: the name of the environment variable. You can reference one or all keys. To reference all keys, specify `sae-sys-configmap-all-<ConfigMap name>`. Example: `sae-sys-configmap-all-test1`.
    *   **valueFrom**: the reference of the environment variable. Set the value to `configMapRef`.
    *   **configMapId**: the ID of the ConfigMap.
    *   **key**: the key. If you want to reference all keys, you do not need to configure this parameter.', example='[{"name":"TEST_ENV_KEY","value":"TEST_ENV_VAR"}]'),
    imagePullSecrets?: string(name='ImagePullSecrets', description='The ID of the corresponding secret.', example='10'),
    imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if **PackageType** is set to **Image**.', example='docker.io/library/nginx:1.14.2'),
    jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the job. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='start'),
    jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the job. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Dtest=true'),
    jdk?: string(name='Jdk', description='The version of the Java Development Kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if **PackageType** is set to **Image**.', example='Open JDK 8'),
    memory?: int32(name='Memory', description='The size of memory that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 2000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24567** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.', example='2048'),
    mountDesc?: [ 
      {
        mountPath?: string(name='MountPath', description='The path on which the NAS file system is mounted.', example='/tmp'),
        nasPath?: string(name='NasPath', description='The directory in the NAS file system.', example='/'),
      }
    ](name='MountDesc', description='The details of the mounted NAS file system.'),
    mountHost?: string(name='MountHost', description='The mount target of the Apsara File Storage NAS (NAS) file system in the virtual private cloud (VPC) where the job template is deployed. If you do not need to modify the NAS configurations when you deploy the job template, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use NAS, leave the **MountHost** parameter empty in the request.', example='example.com'),
    namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-beijing:test'),
    nasConfigs?: string(name='NasConfigs', description='The configurations for mounting the NAS file system.', example='[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]'),
    nasId?: string(name='NasId', description='The ID of the NAS file system.', example='AKSN89**'),
    ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to Object Storage Service (OSS).', example='xxxxxx'),
    ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS.', example='xxxxxx'),
    ossMountDescs?: [ 
      {
        bucketName?: string(name='bucketName', description='The name of the bucket.', example='oss-bucket'),
        bucketPath?: string(name='bucketPath', description='The directory or object in OSS. If the specified directory or object does not exist, an error is returned.', example='data/user.data'),
        mountPath?: string(name='mountPath', description='The path of the container in SAE. The parameter value that you specified overwrites the original value. If the specified path does not exist, SAE automatically creates the path.', example='/usr/data/user.data'),
        readOnly?: boolean(name='readOnly', description='Indicates whether the job template can use the container directory to read data from or write data to resources in the directory of the OSS bucket. Valid values:

*   **true**: The job template has the read-only permissions.
*   **false**: The job template has the read and write permissions.', example='true'),
      }
    ](name='OssMountDescs', description='The description of mounted OSS buckets.'),
    packageType?: string(name='PackageType', description='The type of the deployment package. Valid values:

*   If you deploy a Java job template, you can set this parameter to **FatJar**, **War**, or **Image**.

*   If you deploy a PHP job template, the following types are available:

    *   **PhpZip**
    *   **IMAGE_PHP_5_4**
    *   **IMAGE_PHP_5_4_ALPINE**
    *   **IMAGE_PHP_5_5**
    *   **IMAGE_PHP_5_5_ALPINE**
    *   **IMAGE_PHP_5_6**
    *   **IMAGE_PHP_5_6_ALPINE**
    *   **IMAGE_PHP_7_0**
    *   **IMAGE_PHP_7_0_ALPINE**
    *   **IMAGE_PHP_7_1**
    *   **IMAGE_PHP_7_1_ALPINE**
    *   **IMAGE_PHP_7_2**
    *   **IMAGE_PHP_7_2_ALPINE**
    *   **IMAGE_PHP_7_3**
    *   **IMAGE_PHP_7_3_ALPINE**

*   If you deploy a Python job template, you can set this parameter to **PythonZip** or **Image**.', example='War'),
    packageUrl?: string(name='PackageUrl', description='The URL of the deployment package. This parameter is returned only if **PackageType** is set to **FatJar** or **War**.'),
    packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required only if **PackageType** is set to **FatJar** or **War**.', example='1.0'),
    phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
    phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for job startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
    postStart?: string(name='PostStart', description='The script that is run immediately after the container is started. Example: `{"exec":{"command":["cat","/etc/group"\\\\]}}`', example='{"exec":{"command":["cat","/etc/group"]}}'),
    preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["cat","/etc/group"\\\\]}}`', example='{"exec":{"command":["cat","/etc/group"]}}'),
    programmingLanguage?: string(name='ProgrammingLanguage', description='The programming language in which the job template is created. Valid values:

*   **java**: Java
*   **php**: PHP
*   **python**: Python
*   **other**: other programming languages, such as C++, Go, .NET, and Node.js', example='java'),
    publicWebHookUrls?: [ string ](name='PublicWebHookUrls', description='The Internet request URLs of one-time jobs.'),
    python?: string(name='Python', description='The Python environment. PYTHON 3.9.15 is supported.', example='PYTHON 3.9.15'),
    pythonModules?: string(name='PythonModules', description='The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If no software package is configured, you can specify dependencies based on your business requirements.', example='Flask==2.0'),
    refAppId?: string(name='RefAppId', description='The ID of the job template that you reference.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    refedAppIds?: [ string ](name='RefedAppIds', description='The IDs of the referenced job templates.'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
    replicas?: int32(name='Replicas', description='The number of job instances.', example='2'),
    securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-wz969ngg2e49q5i4****'),
    slice?: boolean(name='Slice', description='Indicates whether job sharding is enabled.', example='true'),
    sliceEnvs?: string(name='SliceEnvs', description='The parameters of job sharding.', example='SliceEnvs'),
    slsConfigs?: string(name='SlsConfigs', description='The logging configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

Parameter description:

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output (stdout) log of the container. Only one stdout value for this parameter can be specified. If this parameter is not configured, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail in Log Service. If this parameter is not configured, a new Logtail is created.

If you do not need to modify the logging configurations when you deploy the application, configure **SlsConfigs** only in the first request. If you no longer need to use Log Service, leave **SlsConfigs** empty in the request.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
    suspend?: boolean(name='Suspend', description='Indicates whether the job template is suspended.', example='false'),
    tags?: [ 
      {
        key?: string(name='Key', description='The tag key.', example='k1'),
        value?: string(name='Value', description='The tag value.', example='v1'),
      }
    ](name='Tags', description='The tags.'),
    terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
    timeout?: long(name='Timeout', description='The timeout period of the job. Unit: seconds.', example='3600'),
    timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
    tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to delete the configuration, set this parameter to {} or leave this parameter empty. Parameter description:

*   **port**: the port number. Valid values: 1024 to 65535. The root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If this parameter is not configured, the default value 8080 is used.
*   **contextPath**: the path. Default value: /. The value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: **UTF-8**, **ISO-8859-1**, **GBK**, and **GB2312**. If this parameter is not configured, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: indicates whether to use the encoding scheme that is specified by **BodyEncoding for URL**. Default value: **true**.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
    triggerConfig?: string(name='TriggerConfig'),
    vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-2ze559r1z1bpwqxwp****'),
    vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-2ze0i263cnn311nvj****'),
    vpcWebHookUrls?: [ string ](name='VpcWebHookUrls', description='The internal request URLs for one-time jobs.'),
    warStartOptions?: string(name='WarStartOptions', description='The option settings in the WAR package. The settings are used to start the job. The default startup command is `java $JAVA_OPTS $CATALINA_OPTS -Options org.apache.catalina.startup.Bootstrap "$@" start`.', example='custom-option'),
    webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. The following versions are supported:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if **PackageType** is set to **Image**.', example='apache-tomcat-7.0.91'),
  }(name='Data', description='The information of the job template.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, **ErrorCode** is not returned.
*   If the call fails, **ErrorCode** is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3****'),
  success?: boolean(name='Success', description='Indicates whether the configurations of the job template were obtained. Valid values:

*   **true**: The configurations were obtained.
*   **false**: The configurations failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622246421415014e****'),
}

model DescribeJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeJobResponseBody(name='body'),
}

/**
 * @summary Queries the configurations of a job template.
 *
 * @param request DescribeJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeJobResponse
 */
async function describeJobWithOptions(request: DescribeJobRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/describeJob`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configurations of a job template.
 *
 * @param request DescribeJobRequest
 * @return DescribeJobResponse
 */
async function describeJob(request: DescribeJobRequest): DescribeJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeJobWithOptions(request, headers, runtime);
}

model DescribeJobHistoryRequest {
  appId?: string(name='AppId', description='The ID of the job template.

This parameter is required.', example='e1a7a07-abcb-4652-a1d3-2d57f415****'),
  currentPage?: long(name='CurrentPage', description='The number of the page to return.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Valid values: 0 to 10000.', example='20'),
  state?: string(name='State', description='The status of the job. Valid values:

*   **0**: The job is not executed.
*   **1**: The job is executed.
*   **2**: The job fails to be executed.
*   **3**: The job is being executed.', example='1'),
}

model DescribeJobHistoryResponseBody = {
  code?: string(name='Code', description='The HTTP status code returned. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    currentPage?: long(name='CurrentPage', description='The page number of the returned page.', example='1'),
    jobs?: [ 
      {
        active?: long(name='Active', description='The number of running instances.', example='0'),
        completionTime?: long(name='CompletionTime', description='The time when the job was executed.', example='1657522839'),
        failed?: long(name='Failed', description='The number of instances that failed to run.', example='0'),
        jobId?: string(name='JobId', description='The job ID.', example='manual-3db7a8fa-5d40-4edc-92e4-49d50eab****'),
        message?: string(name='Message', description='The message returned if exceptions occur during job running.', example='Null'),
        startTime?: long(name='StartTime', description='The time when the job was created.', example='1657522800'),
        state?: string(name='State', description='The status of the job. Valid values:

*   **0**: The job was not executed.
*   **1**: The job was executed.
*   **2**: The job failed to be executed.
*   **3**: The job is being executed.', example='1'),
        succeeded?: long(name='Succeeded', description='The number of instances that are successfully run.', example='3'),
      }
    ](name='Jobs', description='The jobs.'),
    pageSize?: long(name='PageSize', description='The number of entries to return on each page. Valid values: 0 to 10000.', example='20'),
    totalSize?: long(name='TotalSize', description='The total number of jobs.', example='20'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The message returned. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='53F15A18-8079-5992-810C-0211A5AE****'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0b1639af16575057857241351e****'),
}

model DescribeJobHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeJobHistoryResponseBody(name='body'),
}

/**
 * @summary Query the information about jobs.
 *
 * @param request DescribeJobHistoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeJobHistoryResponse
 */
async function describeJobHistoryWithOptions(request: DescribeJobHistoryRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeJobHistoryResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.state)) {
    query['State'] = request.state;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeJobHistory',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/describeJobHistory`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the information about jobs.
 *
 * @param request DescribeJobHistoryRequest
 * @return DescribeJobHistoryResponse
 */
async function describeJobHistory(request: DescribeJobHistoryRequest): DescribeJobHistoryResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeJobHistoryWithOptions(request, headers, runtime);
}

model DescribeJobStatusRequest {
  appId?: string(name='AppId', description='The ID of the job template.

This parameter is required.', example='e1a7a07-abcb-4652-a1d3-2d57f415****'),
  jobId?: string(name='JobId', description='The job ID.', example='event-b798157b-40a2-4388-b578-71fb897103**-**'),
}

model DescribeJobStatusResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    active?: long(name='Active', description='The number of running instances.', example='0'),
    completionTime?: long(name='CompletionTime', description='The time when the job was executed.', example='1657522839'),
    failed?: long(name='Failed', description='The number of instances that failed to run.', example='0'),
    jobId?: string(name='JobId', description='The job ID.', example='event-b798157b-40a2-4388-b578-71fb897103**-**'),
    message?: string(name='Message', description='The returned message. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
    startTime?: long(name='StartTime', description='The time when the job was created.', example='1657522800'),
    state?: string(name='State', description='The status of the job. Valid values:

*   **0**: The job is not executed.
*   **1**: The job was executed.
*   **2**: The job failed to be executed.
*   **3**: The job is being executed.', example='1'),
    succeeded?: long(name='Succeeded', description='The number of instances that are successfully run.', example='3'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   **ErrorCode** is not returned if the request succeeds.
*   **ErrorCode** is returned if the request fails. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='53F15A18-8079-5992-810C-0211A5AE****'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0b1639af16575057857241351e****'),
}

model DescribeJobStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeJobStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of a job.
 *
 * @param request DescribeJobStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeJobStatusResponse
 */
async function describeJobStatusWithOptions(request: DescribeJobStatusRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeJobStatusResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeJobStatus',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/describeJobStatus`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of a job.
 *
 * @param request DescribeJobStatusRequest
 * @return DescribeJobStatusResponse
 */
async function describeJobStatus(request: DescribeJobStatusRequest): DescribeJobStatusResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeJobStatusWithOptions(request, headers, runtime);
}

model DescribeNamespaceRequest {
  nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace. You do not need to specify a region ID. The value of this parameter can be up to 20 characters in length and can contain only lowercase letters and digits.', example='test'),
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace. The information about the default namespace cannot be queried or modified. The default namespace cannot be deleted.', example='cn-beijing:test'),
}

model DescribeNamespaceResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    enableMicroRegistration?: boolean(name='EnableMicroRegistration', description='Indicates whether the SAE built-in registry is enabled. Valid values:

*   **true**
*   **false**', example='true'),
    nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace.', example='test'),
    namespaceDescription?: string(name='NamespaceDescription', description='The description of the namespace.', example='desc'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace. The information about the default namespace cannot be queried or modified. The default namespace cannot be deleted.', example='cn-beijing:test'),
    namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='name'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  }(name='Data', description='The information about the namespace.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   The **ErrorCode** parameter is returned if the request fails. For more information, see the **Error codes** section in this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information about the namespace was queried successfully. Valid values:

*   **true**: The information was queried.
*   **false**: The image failed to be found.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a981dd515966966104121683d****'),
}

model DescribeNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNamespaceResponseBody(name='body'),
}

/**
 * @summary Queries the details of a namespace.
 *
 * @param request DescribeNamespaceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNamespaceResponse
 */
async function describeNamespaceWithOptions(request: DescribeNamespaceRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeNamespaceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNamespace',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/namespace`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a namespace.
 *
 * @param request DescribeNamespaceRequest
 * @return DescribeNamespaceResponse
 */
async function describeNamespace(request: DescribeNamespaceRequest): DescribeNamespaceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeNamespaceWithOptions(request, headers, runtime);
}

model DescribeNamespaceListRequest {
  containCustom?: boolean(name='ContainCustom', description='Specifies whether to return custom namespaces. Valid values:

*   **true**: The system returns custom namespaces.
*   **false**: The system does not return custom namespaces.', example='true'),
  hybridCloudExclude?: boolean(name='HybridCloudExclude', description='Specifies whether to exclude hybrid cloud namespaces from the result. Valid values:

- **true**: The system excludes hybrid cloud namespaces from the result.
- **false**: The system does not exclude hybrid cloud namespaces from the result.', example='true'),
}

model DescribeNamespaceListResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      agentInstall?: string(name='AgentInstall', description='The command that was run to install the agent.', example='http://edas-bj.oss-cn-beijing-internal.aliyuncs.com/test/install.sh'),
      current?: boolean(name='Current', description='This parameter is no longer valid.', example='false'),
      custom?: boolean(name='Custom', description='Indicates whether custom namespaces are returned. Valid values:

*   **true**: Custom namespaces are returned.
*   **false**: Custom namespaces are not returned.', example='true'),
      hybridCloudEnable?: boolean(name='HybridCloudEnable', description='Indicates whether hybrid cloud namespaces are excluded. Valid values:

*   **true**: Hybrid cloud namespaces are excluded.
*   **false**: Hybrid cloud namespaces are included.', example='false'),
      nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace.', example='test'),
      namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-beijing:test'),
      namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='test'),
      regionId?: string(name='RegionId', description='The region to which the namespace belongs.', example='cn-beijing'),
      securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-wz969ngg2e49q5i4****'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-2ze559r1z1bpwqxwp****'),
      vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-2ze0i263cnn311nvj****'),
    }
  ](name='Data', description='The namespaces.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.', example='NULL'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='30375C38-F4ED-4135-A0AE-5C75DC7F****'),
  success?: boolean(name='Success', description='Indicates whether the list of namespaces was queried. Valid values:

*   **true**: The list was queried.
*   **false**: The list failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622920113732501e****'),
}

model DescribeNamespaceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNamespaceListResponseBody(name='body'),
}

/**
 * @summary Queries a list of namespaces.
 *
 * @param request DescribeNamespaceListRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNamespaceListResponse
 */
async function describeNamespaceListWithOptions(request: DescribeNamespaceListRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeNamespaceListResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.containCustom)) {
    query['ContainCustom'] = request.containCustom;
  }
  if (!$isNull(request.hybridCloudExclude)) {
    query['HybridCloudExclude'] = request.hybridCloudExclude;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNamespaceList',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/namespace/describeNamespaceList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of namespaces.
 *
 * @param request DescribeNamespaceListRequest
 * @return DescribeNamespaceListResponse
 */
async function describeNamespaceList(request: DescribeNamespaceListRequest): DescribeNamespaceListResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeNamespaceListWithOptions(request, headers, runtime);
}

model DescribeNamespaceResourcesRequest {
  nameSpaceShortId?: string(name='NameSpaceShortId', example='test'),
  namespaceId?: string(name='NamespaceId', description='cn-shanghai:test', example='cn-shanghai:test'),
}

model DescribeNamespaceResourcesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request failed.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    appCount?: long(name='AppCount', description='The number of applications.', example='1'),
    belongRegion?: string(name='BelongRegion', description='The region to which the namespace belongs.', example='cn-shanghai'),
    description?: string(name='Description', description='The description of the namespace.', example='decs'),
    jumpServerAppId?: string(name='JumpServerAppId', description='The ID of the jump server application.', example='5ec46468-6b26-4a3c-9f7c-bf88761a****'),
    jumpServerIp?: string(name='JumpServerIp', description='The IP address of the jump server.', example='120.78.XXX.XX'),
    lastChangeOrderId?: string(name='LastChangeOrderId', description='The ID of the change order.', example='afedb3c4-63f8-4a3d-aaa3-2c30363f****'),
    lastChangeOrderRunning?: boolean(name='LastChangeOrderRunning', description='Indicates whether a change order is being executed in the namespace. Valid values:

*   **true**: indicates that a change order is being executed in the namespace.
*   **false**: indicates that no change orders are being executed in the namespace.', example='true'),
    lastChangeOrderStatus?: string(name='LastChangeOrderStatus', description='The status of the latest change order. Valid values:

*   **READY**: The change order is ready.
*   **RUNNING**: The change order is being executed.
*   **SUCCESS**: The change order was executed.
*   **FAIL**: The change order could not be executed.
*   **ABORT**: The change order was terminated.
*   **WAIT_BATCH_CONFIRM**: The change order is pending execution. You must manually confirm the release batch.
*   **AUTO_BATCH_WAIT**: The change order is pending execution. SAE will automatically confirm the release batch.
*   **SYSTEM_FAIL**: A system exception occurred.
*   **WAIT_APPROVAL**: The change order is pending approval.
*   **APPROVED**: The change order is approved and is pending execution.', example='SUCCESS'),
    nameSpaceShortId?: string(name='NameSpaceShortId', example='test'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-shangha:test'),
    namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='test'),
    notificationExpired?: boolean(name='NotificationExpired', description='Indicates whether the notification of a change order is expired. Valid values:

*   **true**: indicates that the notification is expired.
*   **false**: indicates that the notification is not expired.', example='true'),
    securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-wz969ngg2e49q5i4****'),
    tenantId?: string(name='TenantId', description='The ID of the tenant in the SAE namespace.', example='838cad95-973f-48fe-830b-2a8546d7****'),
    userId?: string(name='UserId', description='The ID of the user.', example='test@aliyun.com'),
    vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.', example='vsw-2ze559r1z1bpwqxwp****'),
    vSwitchName?: string(name='VSwitchName', description='The name of the vSwitch.', example='test'),
    vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-2ze0i263cnn311nvj****'),
    vpcName?: string(name='VpcName', description='The name of the VPC.', example='test'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information about resources in the namespace was queried successfully. Valid values:

*   **true**: indicates that the query was successful.
*   **false**: indicates that the query failed.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It can be used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model DescribeNamespaceResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNamespaceResourcesResponseBody(name='body'),
}

/**
 * @param request DescribeNamespaceResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNamespaceResourcesResponse
 */
async function describeNamespaceResourcesWithOptions(request: DescribeNamespaceResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeNamespaceResourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNamespaceResources',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/namespace/describeNamespaceResources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeNamespaceResourcesRequest
 * @return DescribeNamespaceResourcesResponse
 */
async function describeNamespaceResources(request: DescribeNamespaceResourcesRequest): DescribeNamespaceResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeNamespaceResourcesWithOptions(request, headers, runtime);
}

model DescribeNamespacesRequest {
  currentPage?: int32(name='CurrentPage', description='The page number.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 0 to 10000.

This parameter is required.', example='10'),
}

model DescribeNamespacesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', description='The page number.', example='1'),
    namespaces?: [ 
      {
        accessKey?: string(name='AccessKey', description='The ACM-specific AccessKey ID. It can be used to manage data in an Application Configuration Management (ACM) namespace. For more information, see [Differences between Alibaba Cloud AccessKey and ACM-specific AccessKey](https://help.aliyun.com/document_detail/68941.html).', example='b34dbe3315c64f9f99b58ea447ec****'),
        addressServerHost?: string(name='AddressServerHost', description='The endpoint of the host.', example='addr-bj-internal.edas.aliyun.com'),
        nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace.', example='test'),
        namespaceDescription?: string(name='NamespaceDescription', description='The description of the namespace.', example='desc'),
        namespaceId?: string(name='NamespaceId', description='The ID of the namespace. You cannot query, modify, or delete the default namespace.', example='cn-beijing:test'),
        namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='name'),
        regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
        secretKey?: string(name='SecretKey', description='The ACM-specific AccessKey secret. It can be used to manage data in an ACM namespace. For more information, see [Differences between Alibaba Cloud AccessKey and ACM-specific AccessKey](https://help.aliyun.com/document_detail/68941.html).', example='G/w6sseK7+nb3S6HBmANDBMD****'),
        tenantId?: string(name='TenantId', description='The tenant ID.', example='838cad95-973f-48fe-830b-2a8546d7****'),
      }
    ](name='Namespaces', description='The namespaces.'),
    pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
    totalSize?: int32(name='TotalSize', description='The total number of namespaces.', example='100'),
  }(name='Data', description='The information of namespaces.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of namespaces was queried. Valid values:

*   **true**: The list was queried.
*   **false**: The list failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a981dd515966966104121683d****'),
}

model DescribeNamespacesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeNamespacesResponseBody(name='body'),
}

/**
 * @summary Queries a list of namespaces.
 *
 * @param request DescribeNamespacesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeNamespacesResponse
 */
async function describeNamespacesWithOptions(request: DescribeNamespacesRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeNamespacesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeNamespaces',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/namespaces`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of namespaces.
 *
 * @param request DescribeNamespacesRequest
 * @return DescribeNamespacesResponse
 */
async function describeNamespaces(request: DescribeNamespacesRequest): DescribeNamespacesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeNamespacesWithOptions(request, headers, runtime);
}

model DescribePipelineRequest {
  pipelineId?: string(name='PipelineId', description='The ID of the batch. You can call the [DescribeChangeOrder](https://help.aliyun.com/document_detail/126617.html) operation to obtain the ID.

This parameter is required.', example='917660ba-5092-44ca-b8e0-80012c96****'),
}

model DescribePipelineResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    coStatus?: string(name='CoStatus', description='The status of the change order for the batch.', example='Successful'),
    currentStageId?: string(name='CurrentStageId', description='The ID of the batch processing stage.', example='c3a55592-4c30-4d84-ac2d-e98c18ec****'),
    nextPipelineId?: string(name='NextPipelineId', description='The ID of the next batch.', example='b77b1c98-5772-4f05-95fc-c7bee5fa****'),
    pipelineId?: string(name='PipelineId', description='The ID of the batch.', example='917660ba-5092-44ca-b8e0-80012c96****'),
    pipelineName?: string(name='PipelineName', description='The name of the batch.', example='First batch'),
    pipelineStatus?: int32(name='PipelineStatus', description='The batch status. Valid values:

*   **0**: The batch is prepared for processing.
*   **1**: The task is being executed.
*   **2**: successful
*   **3**: The processing failed in this stage.
*   **6**: The batch processing was terminated.
*   **10**: The batch could not be processed due to a system exception.', example='2'),
    showBatch?: boolean(name='ShowBatch', description='Indicates whether to start processing the next batch. Valid values:

*   **false**: indicates that the next batch cannot be processed yet.
*   **true**: indicates that the next batch can be processed now.', example='false'),
    stageList?: [ 
      {
        executorType?: int32(name='ExecutorType', description='The execution type of the stage. Valid values:

*   **0**: in sequence.
*   **1**: in parallel.', example='0'),
        stageId?: string(name='StageId', description='The ID of the stage.', example='c3a55592-4c30-4d84-ac2d-e98c18ec****'),
        stageName?: string(name='StageName', description='The name of the stage.', example='Deploy an application'),
        status?: int32(name='Status', description='The status of the batch processing stage. Valid values:

*   **0**: The batch is prepared for this processing stage.
*   **1**: The task is being executed.
*   **2**: successful
*   **3**: The processing failed in this stage.
*   **6**: The processing stage was terminated.', example='2'),
        taskList?: [ 
          {
            errorCode?: string(name='ErrorCode', description='The error code returned when the task could not be executed. If the task is successfully executed, this parameter is not returned.', example='EDAS-10022'),
            errorIgnore?: int32(name='ErrorIgnore', description='Indicates whether to execute the subsequent tasks when the task failed. Valid values:

*   **0**: The subsequent tasks cannot be executed.
*   **1**: The subsequent tasks can be executed.', example='0'),
            errorMessage?: string(name='ErrorMessage', description='The error message returned when the task could not be executed. If the task is successfully executed, this parameter is not returned.', example='EDAS-10022'),
            message?: string(name='Message', description='The returned message indicating the task execution result.', example='init Namespace success'),
            showManualIgnore?: boolean(name='ShowManualIgnore', description='Indicates whether a running task can be manually skipped. Valid values:

*   **true**: The running task can be skipped.
*   **false**: The zone does not allow you to change the network type of an ApsaraDB for Redis instance from classic network to VPC.', example='false'),
            stageId?: string(name='StageId', description='The ID of the stage.', example='c3a55592-4c30-4d84-ac2d-e98c18ec****'),
            status?: int32(name='Status', description='The task status. Valid values:

*   **0**: The task is prepared for execution.
*   **1**: The task is being executed.
*   **2**: successful
*   **3**: The task could not be executed.
*   **5**: The task is pending retry.
*   **6**: The task was terminated.', example='2'),
            taskId?: string(name='TaskId', description='The ID of the task.', example='bef0122f-de9a-4ab0-8223-b88bf8ad****'),
            taskName?: string(name='TaskName', description='The name of the task.', example='Environment initialization'),
          }
        ](name='TaskList', description='The list of task statuses.'),
      }
    ](name='StageList', description='The list of batch processing stages.'),
  }(name='Data', description='The batch information.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='559B4247-C41C-4D9E-B866-B55D360B****'),
  success?: boolean(name='Success', description='Indicates whether the batch information was obtained. Valid values:

*   **true**: The information was queried.
*   **false**: The image failed to be found.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0be3e0c316390414649128666e****'),
}

model DescribePipelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePipelineResponseBody(name='body'),
}

/**
 * @summary View batch information
 *
 * @param request DescribePipelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePipelineResponse
 */
async function describePipelineWithOptions(request: DescribePipelineRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribePipelineResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.pipelineId)) {
    query['PipelineId'] = request.pipelineId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePipeline',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/DescribePipeline`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary View batch information
 *
 * @param request DescribePipelineRequest
 * @return DescribePipelineResponse
 */
async function describePipeline(request: DescribePipelineRequest): DescribePipelineResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describePipelineWithOptions(request, headers, runtime);
}

model DescribeRegionsResponseBody = {
  code?: int32(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName', description='The region name. Valid values:

*   **China (Hangzhou)**
*   **China (Shanghai)**
*   **China (Beijing)**
*   **China (Zhangjiakou)**
*   **China (Shenzhen)**
*   **China (Guangzhou)**
*   **China (Hong Kong)**
*   **Singapore**
*   **US (Silicon Valley)**'),
      recommendZones?: {
        recommendZone?: [ string ](name='RecommendZone')
      }(name='RecommendZones', description='The recommended zones.'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint for the region. Valid values:

*   **sae.cn-hangzhou.aliyuncs.com**
*   **sae.cn-shanghai.aliyuncs.com**
*   **sae.cn-beijing.aliyuncs.com**
*   **sae.cn-zhangjiakou.aliyuncs.com**
*   **sae.cn-shenzhen.aliyuncs.com**
*   **sae.cn-guangzhou.aliyuncs.com**
*   **sae.cn-hongkong.aliyuncs.com**
*   **sae.ap-southeast-1.aliyuncs.com**
*   **sae.us-west-1.aliyuncs.com**', example='sae.cn-shanghai.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID. Valid values:

*   **cn-hangzhou**: the ID of the China (Hangzhou) region
*   **cn-shanghai**: the ID of the China (Shanghai) region
*   **cn-beijing**: the ID of the China (Beijing) region
*   **cn-zhangjiakou**: the ID of the China (Zhangjiakou) region
*   **cn-shenzhen**: the ID of the China (Shenzhen) region
*   **cn-guangzhou**: the ID of the China (Guangzhou) region
*   **cn-hongkong**: the ID of the China (Hong Kong) region
*   **ap-southeast-1**: the ID of the Singapore region
*   **us-west-1**: the ID of the US (Silicon Valley) region', example='cn-shanghai'),
    }
  ](name='Region')
  }(name='Regions', description='The regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DDE85827-B0B3-4E56-86E8-17C42009****'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries available regions.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(headers: map[string]string, runtime: $RuntimeOptions): DescribeRegionsResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/regionConfig`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available regions.
 *
 * @return DescribeRegionsResponse
 */
async function describeRegions(): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeRegionsWithOptions(headers, runtime);
}

model DescribeSecretRequest {
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace where the Secret resides. If the namespace is the default namespace, you need to only enter the region ID, such as `cn-beijing`.

This parameter is required.', example='cn-beijing:test'),
  secretId?: long(name='SecretId', description='The ID of the Secret instance to be queried. You can call the [ListSecrets](https://help.aliyun.com/document_detail/466929.html) operation to view the IDs of Secrete instances.

This parameter is required.', example='16'),
}

model DescribeSecretResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    createTime?: long(name='CreateTime', description='The time when the task was created.', example='1593746835111'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-beijing:test'),
    relateApps?: [ 
      {
        appId?: string(name='AppId', description='The application ID.', example='f16b4000-9058-4c22-a49d-49a28f0b****'),
        appName?: string(name='AppName', description='The name of the application.', example='test-app'),
      }
    ](name='RelateApps', description='The associated application.'),
    secretData?: map[string]string(name='SecretData', description='Secret key-value pair data.'),
    secretId?: long(name='SecretId', description='The ID of the Secret instance.', example='16'),
    secretName?: string(name='SecretName', description='The name of the Secret instance.', example='registry-auth'),
    secretType?: string(name='SecretType', description='The type of the Secret instance.', example='kubernetes.io/dockerconfigjson'),
    updateTime?: long(name='UpdateTime', description='The time when the task was updated.', example='1593746835111'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Valid values:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see **Error codes** in this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the details of the Secret instance are successfully queried. Valid values:

*   **true**: The information was queried.
*   **false**: The image failed to be found.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model DescribeSecretResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecretResponseBody(name='body'),
}

/**
 * @summary Queries the details of a Secret.
 *
 * @param request DescribeSecretRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecretResponse
 */
async function describeSecretWithOptions(request: DescribeSecretRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeSecretResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSecret',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/secret/secret`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a Secret.
 *
 * @param request DescribeSecretRequest
 * @return DescribeSecretResponse
 */
async function describeSecret(request: DescribeSecretRequest): DescribeSecretResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeSecretWithOptions(request, headers, runtime);
}

model DescribeWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
}

model DescribeWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Query web applications.
 *
 * @description Call the DescribeWebApplication operation to query web applications.
 *
 * @param request DescribeWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebApplicationResponse
 */
async function describeWebApplicationWithOptions(ApplicationId: string, request: DescribeWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications/${$URL.percentEncode(ApplicationId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query web applications.
 *
 * @description Call the DescribeWebApplication operation to query web applications.
 *
 * @param request DescribeWebApplicationRequest
 * @return DescribeWebApplicationResponse
 */
async function describeWebApplication(ApplicationId: string, request: DescribeWebApplicationRequest): DescribeWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebApplicationWithOptions(ApplicationId, request, headers, runtime);
}

model DescribeWebApplicationResourceStaticsRequest {
  endTime?: long(name='EndTime', description='The end of the time range during which data was queried.', example='1687832980387'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  startTime?: long(name='StartTime', description='The time when the task was created.', example='1562831689704'),
}

model DescribeWebApplicationResourceStaticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationResourceStaticsBody  
}

/**
 * @summary Query the resource usage of a web application.
 *
 * @description Query the resource usage of a web application.
 *
 * @param request DescribeWebApplicationResourceStaticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebApplicationResourceStaticsResponse
 */
async function describeWebApplicationResourceStaticsWithOptions(ApplicationId: string, request: DescribeWebApplicationResourceStaticsRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebApplicationResourceStaticsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebApplicationResourceStatics',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications-observability/${$URL.percentEncode(ApplicationId)}/resource`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the resource usage of a web application.
 *
 * @description Query the resource usage of a web application.
 *
 * @param request DescribeWebApplicationResourceStaticsRequest
 * @return DescribeWebApplicationResourceStaticsResponse
 */
async function describeWebApplicationResourceStatics(ApplicationId: string, request: DescribeWebApplicationResourceStaticsRequest): DescribeWebApplicationResourceStaticsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebApplicationResourceStaticsWithOptions(ApplicationId, request, headers, runtime);
}

model DescribeWebApplicationRevisionRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeWebApplicationRevisionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationRevisionBody  
}

/**
 * @summary Describe a web application version.
 *
 * @description Describe a web application version.
 *
 * @param request DescribeWebApplicationRevisionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebApplicationRevisionResponse
 */
async function describeWebApplicationRevisionWithOptions(ApplicationId: string, RevisionId: string, request: DescribeWebApplicationRevisionRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebApplicationRevisionResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebApplicationRevision',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-revisions/${$URL.percentEncode(ApplicationId)}/revisions/${$URL.percentEncode(RevisionId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Describe a web application version.
 *
 * @description Describe a web application version.
 *
 * @param request DescribeWebApplicationRevisionRequest
 * @return DescribeWebApplicationRevisionResponse
 */
async function describeWebApplicationRevision(ApplicationId: string, RevisionId: string, request: DescribeWebApplicationRevisionRequest): DescribeWebApplicationRevisionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebApplicationRevisionWithOptions(ApplicationId, RevisionId, request, headers, runtime);
}

model DescribeWebApplicationScalingConfigRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:sae-test'),
}

model DescribeWebApplicationScalingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationScalingConfigBody  
}

/**
 * @summary Describe the scaling configuration of a web application.
 *
 * @description Call the DescribeWebApplicationScalingConfig operation to obtain the scaling configuration of a web application.
 *
 * @param request DescribeWebApplicationScalingConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebApplicationScalingConfigResponse
 */
async function describeWebApplicationScalingConfigWithOptions(ApplicationId: string, request: DescribeWebApplicationScalingConfigRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebApplicationScalingConfigResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebApplicationScalingConfig',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-scaling/${$URL.percentEncode(ApplicationId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Describe the scaling configuration of a web application.
 *
 * @description Call the DescribeWebApplicationScalingConfig operation to obtain the scaling configuration of a web application.
 *
 * @param request DescribeWebApplicationScalingConfigRequest
 * @return DescribeWebApplicationScalingConfigResponse
 */
async function describeWebApplicationScalingConfig(ApplicationId: string, request: DescribeWebApplicationScalingConfigRequest): DescribeWebApplicationScalingConfigResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebApplicationScalingConfigWithOptions(ApplicationId, request, headers, runtime);
}

model DescribeWebApplicationTrafficConfigRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
}

model DescribeWebApplicationTrafficConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationTrafficConfigBody  
}

/**
 * @summary Query the traffic configurations of a web application.
 *
 * @description Call the DescribeWebApplicationTrafficConfig operation to query the traffic configurations of a web application.
 *
 * @param request DescribeWebApplicationTrafficConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebApplicationTrafficConfigResponse
 */
async function describeWebApplicationTrafficConfigWithOptions(ApplicationId: string, request: DescribeWebApplicationTrafficConfigRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebApplicationTrafficConfigResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebApplicationTrafficConfig',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-traffic/${$URL.percentEncode(ApplicationId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the traffic configurations of a web application.
 *
 * @description Call the DescribeWebApplicationTrafficConfig operation to query the traffic configurations of a web application.
 *
 * @param request DescribeWebApplicationTrafficConfigRequest
 * @return DescribeWebApplicationTrafficConfigResponse
 */
async function describeWebApplicationTrafficConfig(ApplicationId: string, request: DescribeWebApplicationTrafficConfigRequest): DescribeWebApplicationTrafficConfigResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebApplicationTrafficConfigWithOptions(ApplicationId, request, headers, runtime);
}

model DescribeWebCustomDomainRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
}

model DescribeWebCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebCustomDomain  
}

/**
 * @summary Query the details of a custom domain name for a web application.
 *
 * @description Query the details of a custom domain name for a web application.
 *
 * @param request DescribeWebCustomDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebCustomDomainResponse
 */
async function describeWebCustomDomainWithOptions(DomainName: string, request: DescribeWebCustomDomainRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebCustomDomainResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebCustomDomain',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/custom-domains/${$URL.percentEncode(DomainName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the details of a custom domain name for a web application.
 *
 * @description Query the details of a custom domain name for a web application.
 *
 * @param request DescribeWebCustomDomainRequest
 * @return DescribeWebCustomDomainResponse
 */
async function describeWebCustomDomain(DomainName: string, request: DescribeWebCustomDomainRequest): DescribeWebCustomDomainResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebCustomDomainWithOptions(DomainName, request, headers, runtime);
}

model DescribeWebInstanceLogsRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
}

model DescribeWebInstanceLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationInstanceLogsBody  
}

/**
 * @summary Obtain the logs of web application instances.
 *
 * @description Obtain the logs of web application instances.
 *
 * @param request DescribeWebInstanceLogsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWebInstanceLogsResponse
 */
async function describeWebInstanceLogsWithOptions(ApplicationId: string, InstanceId: string, request: DescribeWebInstanceLogsRequest, headers: map[string]string, runtime: $RuntimeOptions): DescribeWebInstanceLogsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeWebInstanceLogs',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications-observability/${$URL.percentEncode(ApplicationId)}/instances/${$URL.percentEncode(InstanceId)}/logs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtain the logs of web application instances.
 *
 * @description Obtain the logs of web application instances.
 *
 * @param request DescribeWebInstanceLogsRequest
 * @return DescribeWebInstanceLogsResponse
 */
async function describeWebInstanceLogs(ApplicationId: string, InstanceId: string, request: DescribeWebInstanceLogsRequest): DescribeWebInstanceLogsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return describeWebInstanceLogsWithOptions(ApplicationId, InstanceId, request, headers, runtime);
}

model DisableApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='timer-0800-2100

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  scalingRuleName?: string(name='ScalingRuleName', description='The ID of the request.

This parameter is required.', example='timer-0800-2100'),
}

model DisableApplicationScalingRuleResponseBody = {
  code?: string(name='Code'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='The ID of the trace. The ID is used to query the details of a request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model DisableApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @param request DisableApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableApplicationScalingRuleResponse
 */
async function disableApplicationScalingRuleWithOptions(request: DisableApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): DisableApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/disableApplicationScalingRule`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DisableApplicationScalingRuleRequest
 * @return DisableApplicationScalingRuleResponse
 */
async function disableApplicationScalingRule(request: DisableApplicationScalingRuleRequest): DisableApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return disableApplicationScalingRuleWithOptions(request, headers, runtime);
}

model DowngradeApplicationApmServiceRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
}

model DowngradeApplicationApmServiceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    status?: boolean(name='Status', example='true'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3****'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model DowngradeApplicationApmServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DowngradeApplicationApmServiceResponseBody(name='body'),
}

/**
 * @summary Disables the advanced monitoring feature of Application Real-Time Monitoring Service (ARMS).
 *
 * @param request DowngradeApplicationApmServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DowngradeApplicationApmServiceResponse
 */
async function downgradeApplicationApmServiceWithOptions(request: DowngradeApplicationApmServiceRequest, headers: map[string]string, runtime: $RuntimeOptions): DowngradeApplicationApmServiceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DowngradeApplicationApmService',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/applicationApmService`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables the advanced monitoring feature of Application Real-Time Monitoring Service (ARMS).
 *
 * @param request DowngradeApplicationApmServiceRequest
 * @return DowngradeApplicationApmServiceResponse
 */
async function downgradeApplicationApmService(request: DowngradeApplicationApmServiceRequest): DowngradeApplicationApmServiceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return downgradeApplicationApmServiceWithOptions(request, headers, runtime);
}

model EnableApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  scalingRuleName?: string(name='ScalingRuleName', description='The name of the auto scaling policy.

This parameter is required.', example='timer-0800-2100'),
}

model EnableApplicationScalingRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Specifies whether the instances are successfully restarted. Take note of the following rules:

*   **true**
*   **false**: The restart failed.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model EnableApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @summary Enables an auto scaling policy for an application.
 *
 * @param request EnableApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableApplicationScalingRuleResponse
 */
async function enableApplicationScalingRuleWithOptions(request: EnableApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): EnableApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/enableApplicationScalingRule`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables an auto scaling policy for an application.
 *
 * @param request EnableApplicationScalingRuleRequest
 * @return EnableApplicationScalingRuleResponse
 */
async function enableApplicationScalingRule(request: EnableApplicationScalingRuleRequest): EnableApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return enableApplicationScalingRuleWithOptions(request, headers, runtime);
}

model ExecJobRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='ee1a7a07-abcb-4652-a1d3-2d57f415****'),
  command?: string(name='Command', example='echo'),
  commandArgs?: string(name='CommandArgs', example='["a","b"]'),
  envs?: string(name='Envs', example='[{"name":"envtmp","value":"0"}]'),
  eventId?: string(name='EventId', example='custom'),
  jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the job. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='custom-args'),
  jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the job. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArg`.', example='-Xms4G -Xmx4G'),
  replicas?: string(name='Replicas', description='The number of concurrent instances.', example='3'),
  time?: string(name='Time', description='The time at which the job is triggered. Format: `yyyy-MM-dd\\\\"T\\\\"HH:mm:ss\\\\"Z\\\\"`.', example='2023-09-14T14:25:02Z'),
  warStartOptions?: string(name='WarStartOptions', description='The startup command of the WAR package. For information about how to configure the startup command, see [Configure a startup command](https://help.aliyun.com/document_detail/96677.html).', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
}

model ExecJobResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    code?: string(name='Code', example='200'),
    data?: string(name='Data', example='manual-3db7a8fa-5d40-4edc-92e4-49d50eab****'),
    msg?: string(name='Msg', example='success'),
    success?: string(name='Success', example='true'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='67DD9A98-9CCC-5BE8-8C9E-B45E72F4****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='0b87b7e716575071334387401e****'),
}

model ExecJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecJobResponseBody(name='body'),
}

/**
 * @param request ExecJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecJobResponse
 */
async function execJobWithOptions(request: ExecJobRequest, headers: map[string]string, runtime: $RuntimeOptions): ExecJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.command)) {
    query['Command'] = request.command;
  }
  if (!$isNull(request.commandArgs)) {
    query['CommandArgs'] = request.commandArgs;
  }
  if (!$isNull(request.envs)) {
    query['Envs'] = request.envs;
  }
  if (!$isNull(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!$isNull(request.jarStartArgs)) {
    query['JarStartArgs'] = request.jarStartArgs;
  }
  if (!$isNull(request.jarStartOptions)) {
    query['JarStartOptions'] = request.jarStartOptions;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }
  if (!$isNull(request.time)) {
    query['Time'] = request.time;
  }
  if (!$isNull(request.warStartOptions)) {
    query['WarStartOptions'] = request.warStartOptions;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExecJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/execJob`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ExecJobRequest
 * @return ExecJobResponse
 */
async function execJob(request: ExecJobRequest): ExecJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return execJobWithOptions(request, headers, runtime);
}

model GetApplicationRequest {
  appId?: string(name='AppId', description='The application ID.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  appName?: string(name='AppName', description='The application name.', example='test'),
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-shenzhen'),
}

model GetApplicationResponseBody = {
  application?: {
    appDescription?: string(name='AppDescription', description='The description of the application.'),
    appId?: string(name='AppId', description='The application ID.', example='443d638a-ef76-47c4-b707-61197d******'),
    appName?: string(name='AppName', description='The application name.', example='test'),
    baseAppId?: string(name='BaseAppId', description='The ID of the basic application.', example='ee99cce6-1c8e-4bfa-96c3-3e2fa9******'),
    cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. This parameter cannot be set to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **12000**
*   **16000**
*   **32000**', example='2000'),
    instances?: int32(name='Instances', description='The number of application instances.', example='i-8ps2o182102o1jv05bys'),
    mem?: int32(name='Mem', description='The memory size that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 2000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24576** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.', example='4096'),
    mseEnabled?: boolean(name='MseEnabled', description='Specifies whether to enable WebAssembly Filter. Valid values:

*   true: enables this parameter.
*   false: disables this parameter.', example='true'),
    mseNamespaceId?: string(name='MseNamespaceId', description='The ID of the namespace to which the MSE instance belongs.', example='test'),
    namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-shenzhen'),
    programmingLanguage?: string(name='ProgrammingLanguage', description='The programming language that is used to create the application. Valid values:

*   **java** :Java.
*   **php**: PHP.
*   **other**: other programming languages, such as Python, C++, Go, .NET, and Node.js', example='java'),
    runningInstances?: int32(name='RunningInstances', description='The number of application instances that are running.', example='1'),
    scaleRuleEnabled?: string(name='ScaleRuleEnabled', description='Indicates whether the auto scaling policy is enabled. Valid values:

*   **true**: The auto scaling policy is enabled.
*   **false**: The auto scaling policy is disabled.', example='true'),
    scaleRuleType?: string(name='ScaleRuleType', description='The type of the auto scaling policy. Valid values:

*   **timing**: a scheduled auto scaling policy.
*   **metric**: a metric-based auto scaling policy.
*   **mix**: a hybrid auto scaling policy.', example='timing'),
  }(name='Application', description='The details of the application.'),
  message?: string(name='Message', description='The additional information returned. Valid values:

*   When a request is successful, **success**is returned.
*   An error code is returned when a request failed.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3****'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='ac1a0b2215622920113732501e****'),
}

model GetApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetApplicationResponseBody(name='body'),
}

/**
 * @summary Queries the basic information of an application.
 *
 * @param request GetApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetApplicationResponse
 */
async function getApplicationWithOptions(request: GetApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): GetApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/getApplication`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the basic information of an application.
 *
 * @param request GetApplicationRequest
 * @return GetApplicationResponse
 */
async function getApplication(request: GetApplicationRequest): GetApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getApplicationWithOptions(request, headers, runtime);
}

model GetArmsTopNMetricRequest {
  appSource?: string(name='AppSource', description='The CPU allocation policy. Valid values:

*   **request**: CPU cores are allocated only when a request is initiated.
*   **always**: Fixed CPU cores are always allocated.', example='micro_service'),
  cpuStrategy?: string(name='CpuStrategy', description='The additional information that is returned. The following limits are imposed on the ID:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='always'),
  endTime?: long(name='EndTime', description='The SAE application type. Valid values:

*   **micro_service**
*   **web**
*   **job**

This parameter is required.', example='1675824035951'),
  limit?: long(name='Limit', description='The beginning of the time range to query.

This parameter is required.', example='10'),
  orderBy?: string(name='OrderBy', description='The number of entries to return. Valid values: 0 to 100.

This parameter is required.', example='count'),
  regionId?: string(name='RegionId', description='The field based on which you want to sort the returned entries.

This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The end of the time range to query.

This parameter is required.', example='1675823135951'),
}

model GetArmsTopNMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The following limits are imposed on the ID:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
      count?: long(name='Count', description='The total number of requests.', example='100'),
      error?: long(name='Error', description='The number of errors.', example='0'),
      name?: string(name='Name', description='The application name.', example='test'),
      regionId?: string(name='RegionId', description='The namespace ID.', example='cn-hangzhou'),
      rt?: long(name='Rt', description='The average response time. Unit: milliseconds.', example='100'),
    }
  ](name='Data', description='The details of applications.'),
  message?: string(name='Message', description='The request ID.', example='success'),
  requestId?: string(name='RequestId', description='3B763F98-0BA2-5C23-B6B8-558568D2C1C2', example='3B763F98-0BA2-5C23-B6B8-558568D2****'),
  success?: boolean(name='Success', description='Indicates whether the list of applications was obtained. The following limits are imposed on the ID:

*   **true**: The namespaces were obtained.
*   **false**: no', example='true'),
}

model GetArmsTopNMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetArmsTopNMetricResponseBody(name='body'),
}

/**
 * @summary The application name.
 *
 * @param request GetArmsTopNMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetArmsTopNMetricResponse
 */
async function getArmsTopNMetricWithOptions(request: GetArmsTopNMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): GetArmsTopNMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.cpuStrategy)) {
    query['CpuStrategy'] = request.cpuStrategy;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetArmsTopNMetric',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/getArmsTopNMetric`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The application name.
 *
 * @param request GetArmsTopNMetricRequest
 * @return GetArmsTopNMetricResponse
 */
async function getArmsTopNMetric(request: GetArmsTopNMetricRequest): GetArmsTopNMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getArmsTopNMetricWithOptions(request, headers, runtime);
}

model GetAvailabilityMetricRequest {
  appSource?: string(name='AppSource', description='The SAE application type. Valid values:

*   **micro_service**
*   **web**
*   **job**', example='micro_service'),
  cpuStrategy?: string(name='CpuStrategy', description='The CPU allocation policy. Valid values:

*   **request**: CPU cores are allocated only when a request is initiated.
*   **always**: Fixed CPU cores are always allocated.', example='always'),
  limit?: long(name='Limit', description='The number of entries to return. Valid values: 0 to 100.

This parameter is required.', example='10'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GetAvailabilityMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The following limits are imposed on the ID:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The application ID.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
      enableAutoscale?: long(name='EnableAutoscale', description='Indicates whether an auto scaling policy is enabled. Valid values:

*   **1**: An auto scaling policy is enabled.
*   **0**: No auto scaling policy is enabled.', example='0'),
      errorInstances?: long(name='ErrorInstances', description='The number of abnormal instances.', example='0'),
      instances?: long(name='Instances', description='The expected number of instances.', example='0'),
      name?: string(name='Name', description='The application name.', example='test'),
      regionId?: string(name='RegionId', description='The namespace ID.', example='cn-hangzhou'),
      runnings?: long(name='Runnings', description='The current number of instances.', example='1'),
    }
  ](name='Data', description='The data entries returned.'),
  message?: string(name='Message', description='The additional information that is returned. The following limits are imposed on the ID:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='3A92C4EA-4C53-5A1C-8AEB-F2DB11982D5F'),
  success?: boolean(name='Success', description='Indicates whether the list of applications was obtained. The following limits are imposed on the ID:

*   **true**: The namespaces were obtained.
*   **false**: no', example='true'),
}

model GetAvailabilityMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAvailabilityMetricResponseBody(name='body'),
}

/**
 * @summary Queries the top N applications in which abnormal instances exist. The applications are sorted by the total number of abnormal instances.
 *
 * @param request GetAvailabilityMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAvailabilityMetricResponse
 */
async function getAvailabilityMetricWithOptions(request: GetAvailabilityMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): GetAvailabilityMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.cpuStrategy)) {
    query['CpuStrategy'] = request.cpuStrategy;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAvailabilityMetric',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/getAvailabilityMetric`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the top N applications in which abnormal instances exist. The applications are sorted by the total number of abnormal instances.
 *
 * @param request GetAvailabilityMetricRequest
 * @return GetAvailabilityMetricResponse
 */
async function getAvailabilityMetric(request: GetAvailabilityMetricRequest): GetAvailabilityMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getAvailabilityMetricWithOptions(request, headers, runtime);
}

model GetChangeOrderMetricRequest {
  appId?: string(name='AppId'),
  appSource?: string(name='AppSource', description='The SAE application type. Valid values:

*   **micro_service**
*   **web**
*   **job**', example='micro_service'),
  coType?: string(name='CoType'),
  cpuStrategy?: string(name='CpuStrategy', description='The CPU allocation policy. Valid values:

*   **request**: CPU cores are allocated only when a request is initiated.
*   **always**: Fixed CPU cores are always allocated.', example='always'),
  createTime?: string(name='CreateTime', description='The start time when the change order was created.

This parameter is required.', example='1661152748883'),
  limit?: long(name='Limit', description='The number of entries to return. Valid values: 0 to 100.

This parameter is required.', example='10'),
  orderBy?: string(name='OrderBy', description='The field based on which you want to sort the returned entries.

This parameter is required.', example='errorPercent'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GetChangeOrderMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The following limits are imposed on the ID:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
      avgTimeCostMs?: float(name='AvgTimeCostMs'),
      error?: long(name='Error', description='The number of abnormal change orders.', example='1'),
      errorPercent?: float(name='ErrorPercent', description='The percentage of change failures.', example='0.25'),
      maxTimeCostMs?: float(name='MaxTimeCostMs'),
      name?: string(name='Name', description='The application name.', example='test'),
      optimizeSuggestions?: string(name='OptimizeSuggestions'),
      regionId?: string(name='RegionId', description='The namespace ID.', example='cn-hangzhou'),
      taskTimeCostMsAvg?: string(name='TaskTimeCostMsAvg'),
      total?: long(name='Total', description='The total number of change orders.', example='4'),
    }
  ](name='Data', description='The details of applications.'),
  message?: string(name='Message', description='The additional information that is returned. The following limits are imposed on the ID:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='3B763F98-0BA2-5C23-B6B8-558568D2C1C2'),
  success?: boolean(name='Success', description='Indicates whether the microservice list was obtained. The following limits are imposed on the ID:

*   **true**: The namespaces were obtained.
*   **false**: no', example='true'),
}

model GetChangeOrderMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetChangeOrderMetricResponseBody(name='body'),
}

/**
 * @summary Queries top N applications in abnormal change orders.
 *
 * @param request GetChangeOrderMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetChangeOrderMetricResponse
 */
async function getChangeOrderMetricWithOptions(request: GetChangeOrderMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): GetChangeOrderMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.coType)) {
    query['CoType'] = request.coType;
  }
  if (!$isNull(request.cpuStrategy)) {
    query['CpuStrategy'] = request.cpuStrategy;
  }
  if (!$isNull(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetChangeOrderMetric',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/getChangeOrderMetric`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries top N applications in abnormal change orders.
 *
 * @param request GetChangeOrderMetricRequest
 * @return GetChangeOrderMetricResponse
 */
async function getChangeOrderMetric(request: GetChangeOrderMetricRequest): GetChangeOrderMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getChangeOrderMetricWithOptions(request, headers, runtime);
}

model GetScaleAppMetricRequest {
  appSource?: string(name='AppSource', description='The SAE application type. Valid values:

*   **micro_service**
*   **web**
*   **job**', example='micro_service'),
  cpuStrategy?: string(name='CpuStrategy', description='The CPU allocation policy. Valid values:

*   **request**: CPU cores are allocated only when a request is initiated.
*   **always**: Fixed CPU cores are always allocated.', example='always'),
  limit?: long(name='Limit', description='The number of entries to return. Valid values: 0 to 100.

This parameter is required.', example='10'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model GetScaleAppMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The following limits are imposed on the ID:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
      maxReplicas?: long(name='MaxReplicas', description='The maximum number of instances.', example='10'),
      name?: string(name='Name', description='The application name.', example='test'),
      regionId?: string(name='RegionId', description='The namespace ID.', example='cn-hangzhou'),
      runnings?: long(name='Runnings', description='The current number of instances.', example='10'),
    }
  ](name='Data', description='The details of applications.'),
  message?: string(name='Message', description='The additional information that is returned. The following limits are imposed on the ID:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='3B763F98-0BA2-5C23-B6B8-558568D2C1C2'),
  success?: boolean(name='Success', description='Indicates whether the microservice list was obtained. The following limits are imposed on the ID:

*   **true**: The namespaces were obtained.
*   **false**: no', example='true'),
}

model GetScaleAppMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetScaleAppMetricResponseBody(name='body'),
}

/**
 * @summary Queries the top N applications in which auto scaling takes effect.
 *
 * @param request GetScaleAppMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetScaleAppMetricResponse
 */
async function getScaleAppMetricWithOptions(request: GetScaleAppMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): GetScaleAppMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.cpuStrategy)) {
    query['CpuStrategy'] = request.cpuStrategy;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetScaleAppMetric',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/getScaleAppMetric`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the top N applications in which auto scaling takes effect.
 *
 * @param request GetScaleAppMetricRequest
 * @return GetScaleAppMetricResponse
 */
async function getScaleAppMetric(request: GetScaleAppMetricRequest): GetScaleAppMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getScaleAppMetricWithOptions(request, headers, runtime);
}

model GetWarningEventMetricRequest {
  appSource?: string(name='AppSource', description='The SAE application type. Valid values:

*   **micro_service**
*   **web**
*   **job**', example='micro_service'),
  cpuStrategy?: string(name='CpuStrategy', description='The CPU allocation policy. Valid values:

*   **request**: CPU cores are allocated only when a request is initiated.
*   **always**: Fixed CPU cores are always allocated.', example='always'),
  endTime?: long(name='EndTime', description='The end of the time range to query.

This parameter is required.', example='1675824035951'),
  limit?: long(name='Limit', description='The number of entries to return. Valid values: 0 to 100.

This parameter is required.', example='10'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query.

This parameter is required.', example='1675823135951'),
}

model GetWarningEventMetricResponseBody = {
  code?: string(name='Code', description='The number of Warning events.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The details of the application.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
      name?: string(name='Name', description='The application ID.', example='test'),
      regionId?: string(name='RegionId', description='The application name.', example='cn-hangzhou'),
      warningCount?: long(name='WarningCount', description='The namespace ID.', example='10'),
    }
  ](name='Data', description='3B763F98-0BA2-5C23-B6B8-558568D2C1C2'),
  message?: string(name='Message', description='The additional information that is returned. The following limits are imposed on the ID:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='3B763F98-0BA2-5C23-B6B8-558568D2****'),
  success?: boolean(name='Success', description='The HTTP status code. The following limits are imposed on the ID:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='true'),
}

model GetWarningEventMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWarningEventMetricResponseBody(name='body'),
}

/**
 * @summary The number of Warning events.
 *
 * @param request GetWarningEventMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWarningEventMetricResponse
 */
async function getWarningEventMetricWithOptions(request: GetWarningEventMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): GetWarningEventMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.cpuStrategy)) {
    query['CpuStrategy'] = request.cpuStrategy;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetWarningEventMetric',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/getWarningEventMetric`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The number of Warning events.
 *
 * @param request GetWarningEventMetricRequest
 * @return GetWarningEventMetricResponse
 */
async function getWarningEventMetric(request: GetWarningEventMetricRequest): GetWarningEventMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getWarningEventMetricWithOptions(request, headers, runtime);
}

model GetWebshellTokenRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  containerName?: string(name='ContainerName', description='The name of the container.

Note:

*   If this parameter is specified, Cloud Assistant runs the command in the specified container of the instance.

*   If this parameter is specified, the command can run only on Linux instances on which Cloud Assistant Agent 2.2.3.344 or later is installed.

    *   For information about how to query the version of Cloud Assistant Agent, see [Install Cloud Assistant Agent](https://help.aliyun.com/document_detail/64921.html).
    *   For information about how to upgrade Cloud Assistant Agent, see [Upgrade or disable upgrades for Cloud Assistant Agent](https://help.aliyun.com/document_detail/134383.html).

*   If this parameter is specified, the `Username` parameter that is specified in a request to call this operation and the `WorkingDir` parameter that is specified in a request to call the [CreateCommand](https://help.aliyun.com/document_detail/64844.html) operation do not take effect. You can run the command only in the default working directory of the container by using the default user of the container. For more information, see [Use Cloud Assistant to run commands in containers](https://help.aliyun.com/document_detail/456641.html).

*   If this parameter is specified, only shell scripts can be run in Linux containers. You cannot add a command in the format similar to `#!/usr/bin/python` at the beginning of a script to specify a script interpreter. For more information, see [Use Cloud Assistant to run commands in containers](https://help.aliyun.com/document_detail/456641.html).', example='ad-helper'),
  podName?: string(name='PodName', description='This parameter is required.', example='hello-podsdfsdfsdfsdf'),
}

model GetWebshellTokenResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    httpUrl?: string(name='HttpUrl'),
    token?: string(name='Token', example='zWWpvRj_5pzof4hfo7-hGynM8oGMmO_7'),
    webSocketUrl?: string(name='WebSocketUrl'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model GetWebshellTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebshellTokenResponseBody(name='body'),
}

/**
 * @summary Obtains the token used to remotely log on to the Webshell of an instance.
 *
 * @param request GetWebshellTokenRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWebshellTokenResponse
 */
async function getWebshellTokenWithOptions(request: GetWebshellTokenRequest, headers: map[string]string, runtime: $RuntimeOptions): GetWebshellTokenResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.containerName)) {
    query['ContainerName'] = request.containerName;
  }
  if (!$isNull(request.podName)) {
    query['PodName'] = request.podName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetWebshellToken',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/instance/webshellToken`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the token used to remotely log on to the Webshell of an instance.
 *
 * @param request GetWebshellTokenRequest
 * @return GetWebshellTokenResponse
 */
async function getWebshellToken(request: GetWebshellTokenRequest): GetWebshellTokenResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getWebshellTokenWithOptions(request, headers, runtime);
}

model ListAppEventsRequest {
  appId?: string(name='AppId', description='The application ID.', example='f7730764-d88f-4b9a-8d8e-cd8efbfe****'),
  currentPage?: int32(name='CurrentPage', description='The page number of the page to return.', example='1'),
  eventType?: string(name='EventType', description='The type of the event. Valid values:

*   **Warning**: an alert.
*   **Normal**: a normal event.', example='Warning'),
  namespace?: string(name='Namespace', description='The namespace ID.

This parameter is required.', example='cn-beijing'),
  objectKind?: string(name='ObjectKind', description='The type of the object. Valid values:

*   **Deployment**: an application.
*   **Pod**: an application instance.
*   **Service**: a Server Load Balancer (SLB) instance.
*   **HorizontalPodAutoscaler**: an auto scaling policy.
*   **CloneSet**: an application.', example='Pod'),
  objectName?: string(name='ObjectName', description='The name of the object. Fuzzy search by prefix is supported.', example='errew-b86bf540-b4dc-47d8-a42f-b4997c14bd8f-5595cbddd6-x****'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 0 to 10000.', example='10'),
  reason?: string(name='Reason', description='The cause of the event. Fuzzy search by prefix is supported.', example='Started'),
}

model ListAppEventsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appEventEntity?: [ 
      {
        eventType?: string(name='EventType', description='The type of the event. Valid values:', example='Normal'),
        firstTimestamp?: string(name='FirstTimestamp', description='The timestamp of the first occurrence of the event.', example='2020-02-19T05:01:28Z'),
        lastTimestamp?: string(name='LastTimestamp', description='The timestamp of the last occurrence of the event.', example='2020-02-19T05:01:28Z'),
        message?: string(name='Message', description='The information about the event.', example='Created container'),
        objectKind?: string(name='ObjectKind', description='The type of the object.', example='Pod'),
        objectName?: string(name='ObjectName', description='The name of the object.', example='errew-b86bf540-b4dc-47d8-a42f-b4997c14bd8f-5595cbddd6-2****'),
        reason?: string(name='Reason', description='The cause of the event.', example='Created'),
      }
    ](name='AppEventEntity', description='The events.'),
    currentPage?: int32(name='CurrentPage', description='The number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
    totalSize?: int32(name='TotalSize', description='The total number of events that occurred in an application.', example='20'),
  }(name='Data', description='The events.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the call failed. Take note of the following rules:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='B4D805CA-926D-41B1-8E63-7AD0C1ED****'),
  success?: boolean(name='Success', description='Indicates whether the events that occurred in the application were queried. Valid values:

*   **true**: The events were queried.
*   **false**: The events failed to be queried.', example='true'),
}

model ListAppEventsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppEventsResponseBody(name='body'),
}

/**
 * @summary Queries the events that occurred in an application.
 *
 * @param request ListAppEventsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppEventsResponse
 */
async function listAppEventsWithOptions(request: ListAppEventsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAppEventsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!$isNull(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!$isNull(request.objectKind)) {
    query['ObjectKind'] = request.objectKind;
  }
  if (!$isNull(request.objectName)) {
    query['ObjectName'] = request.objectName;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.reason)) {
    query['Reason'] = request.reason;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppEvents',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/listAppEvents`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the events that occurred in an application.
 *
 * @param request ListAppEventsRequest
 * @return ListAppEventsResponse
 */
async function listAppEvents(request: ListAppEventsRequest): ListAppEventsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppEventsWithOptions(request, headers, runtime);
}

model ListAppServicesRequest {
  appId?: string(name='AppId', description='The ID of the application. You must specify only one of the following parameters: vpcId, namespace ID, and application ID.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  nacosInstanceId?: string(name='NacosInstanceId', description='The ID of the MSE Nacos instance. This parameter is required when the registry type is set to MSE Nacos.', example='mse-cn-sco3r0u****'),
  nacosNamespaceId?: string(name='NacosNamespaceId', description='The ID of the MSE Nacos namespace. This parameter is required when the registry type is set to MSE Nacos.', example='mse-test'),
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace. You must specify only one of the following parameters: VPC ID, namespace ID, and application ID.', example='cn-beijing:test'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  registryType?: string(name='RegistryType', description='The registry type. Valid values:

*   **0**: SAE Nacos
*   **1**: SAE built-in Nacos
*   **2** :MSE Nacos
*   **9**: SAE Kubernetes service', example='0'),
  serviceType?: string(name='ServiceType', description='The service type. Valid values:

*   **dubbo**
*   **springCloud**
*   **hsf**
*   **k8sService**', example='springCloud'),
  vpcId?: string(name='VpcId', description='The unique identifier of the VPC. You must specify only one of the following parameters: VPC ID, namespace ID, and application ID.', example='vpc-2ze0i263cnn311nvj****'),
}

model ListAppServicesResponseBody = {
  code?: string(name='Code', description='The HTTP status code that is returned. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The application ID.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
      appName?: string(name='AppName', description='The name of the application.', example='demo-app'),
      instanceCount?: string(name='InstanceCount', description='The number of instances of the microservice.', example='1'),
      namespaceId?: string(name='NamespaceId', description='The ID of the namespace to which the application belongs.', example='cn-beijing:test'),
      namespaceName?: string(name='NamespaceName', description='The name of the namespace.'),
      registryType?: string(name='RegistryType', description='The registry type. Valid values:

*   **0**：SAE Nacos
*   **1**: SAE built-in Nacos
*   **2**: MSE Nacos
*   **9**: SAE Kubernets service', example='0'),
      securityGroupId?: string(name='SecurityGroupId', description='The IDs of the security groups.', example='sg-wz969ngg2e49q5i4****'),
      serviceGroup?: string(name='ServiceGroup', description='The group to which the microservice belongs.', example='DEFAULT_GROUP'),
      serviceName?: string(name='ServiceName', description='The name of the microservice.', example='frontend'),
      servicePortAndProtocol?: map[string]string(name='ServicePortAndProtocol', description='The ports and protocols.'),
      servicePorts?: [ int32 ](name='ServicePorts', description='The list of ports.'),
      serviceProtocol?: string(name='ServiceProtocol', description='The protocol used by the microservice.', example='HTTP'),
      serviceType?: string(name='ServiceType', description='The type of the microservice. Valid values:

*   **dubbo**
*   **springCloud**
*   **hsf**
*   **k8sService**', example='springCloud'),
      serviceVersion?: string(name='ServiceVersion', description='The version of the microservice.', example='1.0.0'),
    }
  ](name='Data', description='The details of the microservice.'),
  errorCode?: string(name='ErrorCode', description='The status code. Valid values:

*   If the request was successful, the **ErrorCode** parameter is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   If the request was successful, **success** is returned.
*   If the request failed, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model ListAppServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppServicesResponseBody(name='body'),
}

/**
 * @summary Queries the list of microservices
 *
 * @param request ListAppServicesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppServicesResponse
 */
async function listAppServicesWithOptions(request: ListAppServicesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAppServicesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.nacosInstanceId)) {
    query['NacosInstanceId'] = request.nacosInstanceId;
  }
  if (!$isNull(request.nacosNamespaceId)) {
    query['NacosNamespaceId'] = request.nacosNamespaceId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.registryType)) {
    query['RegistryType'] = request.registryType;
  }
  if (!$isNull(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppServices',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/service/listAppServices`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the list of microservices
 *
 * @param request ListAppServicesRequest
 * @return ListAppServicesResponse
 */
async function listAppServices(request: ListAppServicesRequest): ListAppServicesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppServicesWithOptions(request, headers, runtime);
}

model ListAppServicesPageRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='6dcc8c9e-d3da-478a-a066-86dcf820****'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page. Valid values: 0 to 9999.', example='9999'),
  serviceType?: string(name='ServiceType', description='The service type. Valid values:

*   **dubbo**
*   **springCloud**

This parameter is required.', example='springCloud'),
}

model ListAppServicesPageResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      currentPage?: string(name='CurrentPage', description='The page number of the current page.', example='1'),
      pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
      pageSize?: string(name='PageSize', description='The number of entries returned on each page. Valid values: 0 to 9999.', example='9999'),
      result?: [ 
        {
          edasAppId?: string(name='EdasAppId', description='The ID of the application.', example='hc4fs1****@98314c8790b****'),
          edasAppName?: string(name='EdasAppName', description='The name of the application.', example='cn-zhangjiakou-micro-service-******'),
          group?: string(name='Group', description='The group to which the service belongs. You can create a custom group.', example='springCloud'),
          instanceNum?: long(name='InstanceNum', description='The number of instances.', example='1'),
          serviceName?: string(name='ServiceName', description='The service name.', example='edas.service.provider'),
          version?: string(name='Version', description='The version of a service. You can create a custom version.', example='1.0.0'),
        }
      ](name='Result', description='The result returned.'),
      totalSize?: string(name='TotalSize', description='The total number of returned pages.', example='1'),
    }
  ](name='Data', description='The details of services.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** section of this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2583E089-99C2-562E-8B7E-73512136****'),
  success?: boolean(name='Success', description='Indicates whether the microservice list was obtained. Valid values:

*   **true**: The list was obtained.
*   **false**: The list failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0be3e0c816394483660457498e****'),
}

model ListAppServicesPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppServicesPageResponseBody(name='body'),
}

/**
 * @summary Queries the services of an application.
 *
 * @param request ListAppServicesPageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppServicesPageResponse
 */
async function listAppServicesPageWithOptions(request: ListAppServicesPageRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAppServicesPageResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppServicesPage',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/service/listAppServicesPage`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the services of an application.
 *
 * @param request ListAppServicesPageRequest
 * @return ListAppServicesPageResponse
 */
async function listAppServicesPage(request: ListAppServicesPageRequest): ListAppServicesPageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppServicesPageWithOptions(request, headers, runtime);
}

model ListAppVersionsRequest {
  appId?: string(name='AppId', description='The returned message.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
}

model ListAppVersionsResponseBody = {
  code?: string(name='Code', description='Indicates whether the historical versions of the application were obtained. Valid values:

*   **true**: indicates that the historical versions of the application were obtained.
*   **false**: indicates that the historical versions of the application could not be obtained.', example='200'),
  data?: [ 
    {
      buildPackageUrl?: string(name='BuildPackageUrl', description='The URL of the code package. If you use the SAE console to upload the code package, take note of the following items:

*   You cannot download the URL. You must call the GetPackageVersionAccessableUrl operation to obtain the URL. The obtained URL is valid for 10 minutes.
*   SAE can retain the package up to 90 days. After 90 days, the URL cannot be returned or downloaded.'),
      createTime?: string(name='CreateTime', description='The download link of the WAR or JAR package. This parameter is returned when the **Type** parameter is set to **url**.', example='1590124643553'),
      id?: string(name='Id', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='a0ce266c-d354-423a-9bd6-4083405a****'),
      type?: string(name='Type', description='The deployment method of the application. Valid values:

*   **image**: indicates that the application is deployed by using an image.
*   **url**: indicates that the application is deployed by using a code package.', example='image'),
      warUrl?: string(name='WarUrl', description='The URL of the image.'),
    }
  ](name='Data', description='The information about the versions.'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the request.', example='success'),
  requestId?: string(name='RequestId', description='The information about the versions.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3****'),
  success?: boolean(name='Success', example='true'),
}

model ListAppVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppVersionsResponseBody(name='body'),
}

/**
 * @summary Queries the deployment versions of an application.
 *
 * @param request ListAppVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppVersionsResponse
 */
async function listAppVersionsWithOptions(request: ListAppVersionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAppVersionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppVersions',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/listAppVersions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the deployment versions of an application.
 *
 * @param request ListAppVersionsRequest
 * @return ListAppVersionsResponse
 */
async function listAppVersions(request: ListAppVersionsRequest): ListAppVersionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppVersionsWithOptions(request, headers, runtime);
}

model ListApplicationsRequest {
  appName?: string(name='AppName', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='demo-app'),
  appSource?: string(name='AppSource', description='The SAE application type. Valid values:

- **micro_service**
- **web**
- **job**', example='micro_service'),
  currentPage?: int32(name='CurrentPage', description='The number of the returned page.', example='1'),
  fieldType?: string(name='FieldType', description='true', example='appName'),
  fieldValue?: string(name='FieldValue', description='The ID of the region.', example='demo-app'),
  namespaceId?: string(name='NamespaceId', description='1', example='cn-beijing:demo'),
  orderBy?: string(name='OrderBy', description='runnings', example='running'),
  pageSize?: int32(name='PageSize', description='Indicates whether the application is being deleted. Valid values:

*   **true**: The application is being deleted.
*   **false**: The application is not being deleted.', example='20'),
  reverse?: boolean(name='Reverse', description='The returned message.', example='true'),
  tags?: string(name='Tags', description='The list of applications.', example='[{"key":"key","value":"value"}]'),
}

model ListApplicationsResponseBody = {
  code?: string(name='Code', description='Queries applications.', example='200'),
  currentPage?: int32(name='CurrentPage', description='20', example='1'),
  data?: {
    applications?: [ 
      {
        appDeletingStatus?: boolean(name='AppDeletingStatus', description='Indicates whether the application is being deleted. Valid values:

*   **true**: The application is being deleted.
*   **false**: The application is not being deleted.', example='false'),
        appDescription?: string(name='AppDescription', description='The description of the application.', example='description'),
        appId?: string(name='AppId', description='The application ID.', example='f7730764-d88f-4b9a-8d8e-cd8efbfe****'),
        appName?: string(name='AppName', description='The application name.', example='demo-app'),
        appType?: string(name='AppType'),
        baseAppId?: string(name='BaseAppId'),
        children?: [ 
          {
            appDeletingStatus?: boolean(name='AppDeletingStatus'),
            appDescription?: string(name='AppDescription'),
            appId?: string(name='AppId'),
            appName?: string(name='AppName'),
            appType?: string(name='AppType'),
            baseAppId?: string(name='BaseAppId'),
            cpu?: int32(name='Cpu'),
            instances?: int32(name='Instances'),
            mem?: int32(name='Mem'),
            mseEnabled?: boolean(name='MseEnabled'),
            namespaceId?: string(name='NamespaceId'),
            namespaceName?: string(name='NamespaceName'),
            newSaeVersion?: string(name='NewSaeVersion'),
            programmingLanguage?: string(name='ProgrammingLanguage'),
            regionId?: string(name='RegionId'),
            runningInstances?: int32(name='RunningInstances'),
            scaleRuleEnabled?: boolean(name='ScaleRuleEnabled'),
            scaleRuleType?: string(name='ScaleRuleType'),
            tags?: [ 
              {
                key?: string(name='Key'),
                value?: string(name='Value'),
              }
            ](name='Tags'),
          }
        ](name='Children'),
        cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. This parameter cannot be set to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **16000**
*   **32000**', example='1000'),
        diskSize?: int32(name='DiskSize'),
        enableIdle?: string(name='EnableIdle'),
        imageUrl?: string(name='ImageUrl'),
        instances?: int32(name='Instances', description='The number of application instances.', example='2'),
        mem?: int32(name='Mem', description='The memory size that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 2000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24576** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.', example='1024'),
        mseEnabled?: boolean(name='MseEnabled'),
        mseNamespaceId?: string(name='MseNamespaceId'),
        namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-beijing:demo'),
        namespaceName?: string(name='NamespaceName'),
        newSaeVersion?: string(name='NewSaeVersion'),
        packageUrl?: string(name='PackageUrl'),
        programmingLanguage?: string(name='ProgrammingLanguage'),
        regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
        runningInstances?: int32(name='RunningInstances', description='The number of running instances.', example='2'),
        tags?: [ 
          {
            key?: string(name='Key', description='The key of the tag.', example='key'),
            value?: string(name='Value', description='The value of the tag.', example='value'),
          }
        ](name='Tags', description='The tags of the application.'),
      }
    ](name='Applications', description='The applications.'),
    currentPage?: int32(name='CurrentPage', description='The number of application instances.', example='1'),
    pageSize?: int32(name='PageSize', description='The tags of the application.', example='20'),
    totalSize?: int32(name='TotalSize', description='The information about applications.', example='2'),
  }(name='Data', description='The queried applications.'),
  errorCode?: string(name='ErrorCode', description='The number of entries returned on each page.', example='The ID of the request.'),
  message?: string(name='Message', description='20', example='success'),
  pageSize?: int32(name='PageSize', description='cn-beijing:demo', example='20'),
  requestId?: string(name='RequestId', description='The number of entries returned on each page.', example='B4D805CA-926D-41B1-8E63-7AD0C1ED****'),
  success?: boolean(name='Success', description='1', example='true'),
  totalSize?: int32(name='TotalSize', description='demo-app', example='2'),
}

model ListApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of applications.
 *
 * @param request ListApplicationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListApplicationsResponse
 */
async function listApplicationsWithOptions(request: ListApplicationsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListApplicationsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.appSource)) {
    query['AppSource'] = request.appSource;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.fieldType)) {
    query['FieldType'] = request.fieldType;
  }
  if (!$isNull(request.fieldValue)) {
    query['FieldValue'] = request.fieldValue;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.reverse)) {
    query['Reverse'] = request.reverse;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListApplications',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/listApplications`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of applications.
 *
 * @param request ListApplicationsRequest
 * @return ListApplicationsResponse
 */
async function listApplications(request: ListApplicationsRequest): ListApplicationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listApplicationsWithOptions(request, headers, runtime);
}

model ListChangeOrdersRequest {
  appId?: string(name='AppId', description='1

This parameter is required.', example='145341c-9708-4967-b3ec-24933767****'),
  coStatus?: string(name='CoStatus', description='The ID of the request.', example='2'),
  coType?: string(name='CoType', description='The type of the change order. Valid values:

*   **CoBindSlb**: associates the Server Load Balancer (SLB) instance with the application.
*   **CoUnbindSlb**: disassociates an SLB instance from the application.
*   **CoCreateApp**: creates the application.
*   **CoDeleteApp**: deletes the application.
*   **CoDeploy**: deploys the application.
*   **CoRestartApplication**: restarts the application.
*   **CoRollback**: rolls back the application.
*   **CoScaleIn**: scales in the application.
*   **CoScaleOut**: scales out the application.
*   **CoStartApplication**: starts the application.
*   **CoStopApplication**: stops the application.
*   **CoRescaleApplicationVertically**: modifies the instance type.
*   **CoDeployHistroy**: rolls back the application to an earlier version.
*   **CoBindNas**: associates a network-attached storage (NAS) file system with the application.
*   **CoUnbindNas**: disassociates a NAS file system from the application.
*   **CoBatchStartApplication**: starts multiple applications concurrently.
*   **CoBatchStopApplication**: stops multiple applications concurrently.
*   **CoRestartInstances**: restarts the instance.
*   **CoDeleteInstances**: deletes the instance.
*   **CoScaleInAppWithInstances**: reduces the specified number of application instances.', example='CoCreateApp'),
  currentPage?: int32(name='CurrentPage', description='20', example='1'),
  key?: string(name='Key', description='CoCreateApp', example='test'),
  orderBy?: string(name='OrderBy'),
  pageSize?: int32(name='PageSize', description='test', example='20'),
  reverse?: boolean(name='Reverse'),
}

model ListChangeOrdersResponseBody = {
  code?: string(name='Code', description='Indicates whether the list of change orders was obtained. Valid values:

*   **true**: indicates that the list was obtained.
*   **false**: indicates that the list could not be obtained.', example='200'),
  data?: {
    changeOrderList?: [ 
      {
        appId?: string(name='AppId', description='The number of entries returned on each page.', example='164341c-9708-4967-b3ec-24933767****'),
        batchCount?: int32(name='BatchCount', description='The ID of the user who created the change order.', example='1'),
        batchType?: string(name='BatchType', description='The ID of the group.', example='auto'),
        changeOrderId?: string(name='ChangeOrderId', description='The mode in which the release batches are determined. Valid values:

*   **auto**: SAE automatically determines the release batches.
*   **manual**: You must manually determine the release batches.', example='7fa5c0-9ebb-4bb4-b383-1f885447****'),
        coType?: string(name='CoType', description='The ID of the application.'),
        coTypeCode?: string(name='CoTypeCode', description='The code of the change order. Valid values:

*   **CoBindSlb**: associates the Server Load Balancer (SLB) instance with the application.
*   **CoUnbindSlb**: disassociates an SLB instance from the application.
*   **CoCreateApp**: creates the application.
*   **CoDeleteApp**: deletes the application.
*   **CoDeploy**: deploys the application.
*   **CoRestartApplication**: restarts the application.
*   **CoRollback**: rolls back the application.
*   **CoScaleIn**: scales in the application.
*   **CoScaleOut**: scales out the application.
*   **CoStartApplication**: starts the application.
*   **CoStopApplication**: stops the application.
*   **CoRescaleApplicationVertically**: modifies the instance type.
*   **CoDeployHistroy**: rolls back the application to an earlier version.
*   **CoBindNas**: associates a network-attached storage (NAS) file system with the application.
*   **CoUnbindNas**: disassociates a NAS file system from the application.
*   **CoBatchStartApplication**: starts multiple applications concurrently.
*   **CoBatchStopApplication**: stops multiple applications concurrently.
*   **CoRestartInstances**: restarts the instance.
*   **CoDeleteInstances**: deletes the instance.
*   **CoScaleInAppWithInstances**: reduces the specified number of application instances.', example='CoCreateApp'),
        createTime?: string(name='CreateTime', description='The ID of the user.', example='2019-07-11 15:54:49'),
        createUserId?: string(name='CreateUserId', description='The code of the change type. Valid values:

*   **CoBindSlb**: associates an SLB instance with the application.
*   **CoUnbindSlb**: disassociates the SLB instance from the application.
*   **CoCreateApp**: creates the application.
*   **CoDeleteApp**: deletes the application.
*   **CoDeploy**: deploys the application.
*   **CoRestartApplication**: restarts the application.
*   **CoRollback**: rolls back the application.
*   **CoScaleIn**: scales in the application.
*   **CoScaleOut**: scales out the application.
*   **CoStart**: starts the application.
*   **CoStop**: stops the application.
*   **CoRescaleApplicationVertically**: modifies the instance specifications.
*   **CoDeployHistroy**: rolls back the application to a historical version.
*   **CoBindNas**: associates a NAS file system with the application.
*   **CoUnbindNas**: disassociates the NAS file system from the application.
*   **CoBatchStartApplication**: starts multiple applications concurrently.
*   **CoBatchStopApplication**: stops multiple applications concurrently.
*   **CoRestartInstances**: restarts the instances.
*   **CoDeleteInstances**: deletes the instances.
*   **CoScaleInAppWithInstances**: reduces the number of the specified application instances.', example='sae-beta-test'),
        description?: string(name='Description', description='The change type, which corresponds to the **CoTypeCode** parameter.'),
        finishTime?: string(name='FinishTime', description='The time when the change order was created.', example='2019-07-11 20:12:58'),
        groupId?: string(name='GroupId', description='The description about the application.', example='c9ecd2-cf6c-46c3-9f20-525de202****'),
        source?: string(name='Source', description='The number of release batches.', example='console'),
        status?: int32(name='Status', description='The time when the change order was completed.', example='2'),
        userId?: string(name='UserId', description='The source of the change order.', example='sae-beta-test'),
      }
    ](name='ChangeOrderList', description='The change orders.'),
    currentPage?: int32(name='CurrentPage', description='The total number of change orders.', example='1'),
    pageSize?: int32(name='PageSize', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='20'),
    totalSize?: int32(name='TotalSize', description='The list of change orders.', example='1'),
  }(name='Data', description='The information about change orders.'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. It is used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.', example='65E1F-43BA-4D0C-8E61-E4D1337F****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The information about change orders.', example='0bb6f815638568884597879d****'),
}

model ListChangeOrdersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChangeOrdersResponseBody(name='body'),
}

/**
 * @summary Query a list of change orders.
 *
 * @param request ListChangeOrdersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChangeOrdersResponse
 */
async function listChangeOrdersWithOptions(request: ListChangeOrdersRequest, headers: map[string]string, runtime: $RuntimeOptions): ListChangeOrdersResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.coStatus)) {
    query['CoStatus'] = request.coStatus;
  }
  if (!$isNull(request.coType)) {
    query['CoType'] = request.coType;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.reverse)) {
    query['Reverse'] = request.reverse;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListChangeOrders',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/ListChangeOrders`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query a list of change orders.
 *
 * @param request ListChangeOrdersRequest
 * @return ListChangeOrdersResponse
 */
async function listChangeOrders(request: ListChangeOrdersRequest): ListChangeOrdersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listChangeOrdersWithOptions(request, headers, runtime);
}

model ListConsumedServicesRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
}

model ListConsumedServicesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
      group2Ip?: string(name='Group2Ip', description='This parameter is reserved.', example='{}'),
      groups?: [ string ](name='Groups', description='The service groups that corresponds to the consumed services.'),
      ips?: [ string ](name='Ips', description='The addresses where the services can be subscribed to.'),
      name?: string(name='Name', description='The name of the published service.', example='com.alibaba.nodejs.ItemService'),
      type?: string(name='Type', description='The type of the published service.', example='RPC'),
      version?: string(name='Version', description='The version of the published service.', example='1.0.0'),
    }
  ](name='Data', description='The details of the microservices.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of microservices was queried. Valid values:

*   **true**: The list was queried.
*   **false**: The list failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model ListConsumedServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConsumedServicesResponseBody(name='body'),
}

/**
 * @summary Queries a list of microservices that are subscribed.
 *
 * @param request ListConsumedServicesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConsumedServicesResponse
 */
async function listConsumedServicesWithOptions(request: ListConsumedServicesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListConsumedServicesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListConsumedServices',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/service/listConsumedServices`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of microservices that are subscribed.
 *
 * @param request ListConsumedServicesRequest
 * @return ListConsumedServicesResponse
 */
async function listConsumedServices(request: ListConsumedServicesRequest): ListConsumedServicesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listConsumedServicesWithOptions(request, headers, runtime);
}

model ListGreyTagRouteRequest {
  appId?: string(name='AppId', description='7171a6ca-d1cd-4928-8642-7d5cfe69\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
}

model ListGreyTagRouteResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

- **2xx**: The call was successful.
- **3xx**: The call was redirected.
- **4xx**: The call failed.
- **5xx**: A server error occurred.', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned on each page. Valid value: **1**.', example='1'),
    result?: [ 
      {
        albRules?: [ 
          {
            condition?: string(name='condition', example='AND'),
            ingressId?: string(name='ingressId', example='23'),
            items?: [ 
              {
                cond?: string(name='cond', example='=='),
                expr?: string(name='expr', example='N/A'),
                index?: int32(name='index', example='N/A'),
                name?: string(name='name', example='example'),
                operator?: string(name='operator', example='rawvalue'),
                type?: string(name='type', example='cookie'),
                value?: string(name='value', example='test'),
              }
            ](name='items'),
            serviceName?: string(name='serviceName', example='s-6366-e3****-99**'),
          }
        ](name='AlbRules'),
        createTime?: long(name='CreateTime', description='The timestamp when the canary release rule was created. Unit: milliseconds.', example='1619007592013'),
        description?: string(name='Description', description='The description of the canary release rule.', example='test'),
        dubboRules?: [ 
          {
            condition?: string(name='condition', description='The relationship between the conditions in the canary release rule. Valid values:

- **AND**: The conditions are in the logical AND relation. All conditions must be met at the same time.
- **OR**: The conditions are in the logical OR relation. At least one of the conditions must be met.', example='OR'),
            group?: string(name='group', description='The group of the Dubbo service that corresponds to the canary release rule.', example='DUBBO'),
            items?: [ 
              {
                cond?: string(name='cond', description='The comparison operator. Valid values: **>**, **<**, **>=**, **<=**, **==**, and **! =**.', example='=='),
                expr?: string(name='expr', description='The expression that is used to obtain the value of the parameter. The syntax of the expression must follow the standard of the SpEL. Valid values:

- **Empty**: obtains the value of the parameter.
- **.name**: obtains the name property of the parameter. This expression works the same way as args0.getName().
- **.isEnabled()**: obtains the enabled property of the parameter. This expression works the same way as args0.isEnabled().
- **[0]**: indicates that the value of the parameter is an array and obtains the first value of the array. This expression works the same way as args0[0]. This expression does not start with a period (.).
- **.get(0)**: indicates that the value of the parameter is a list and obtains the first value of the list. This expression works the same way as args0.get(0).
- **.get("key")**: indicates that the value of the parameter is a map and obtains the value of the key in the map. This expression works the same way as args0.get("key").  >  For more information about the expressions that are used to obtain parameter values, see  [Spring Expression Language (SpEL)](https://docs.spring.io/spring-integration/docs/current/reference/html/spel.html).', example='.name'),
                index?: int32(name='index', description='The index of the parameter. The value 0 indicates the first parameter.', example='0'),
                name?: string(name='name', description='This parameter is not returned for Dubbo services.', example='N/A'),
                operator?: string(name='operator', description='The operator. Valid values:

- **rawvalue**: direct comparison.
- **list**: whitelist.
- **mod**: mods 100.
- **deterministic_proportional_steaming_division**: percentage.', example='rawvalue'),
                type?: string(name='type', description='This parameter is not returned for Dubbo services.', example='N/A'),
                value?: string(name='value', description='The value of the parameter. This value is compared with the value that is obtained based on the **expr** and **index** parameters.', example='test'),
              }
            ](name='items', description='The conditions.'),
            methodName?: string(name='methodName', description='The method name of the Dubbo service.', example='echo'),
            serviceName?: string(name='serviceName', description='The name of the Dubbo service.', example='com.alibaba.edas.boot.EchoService'),
            version?: string(name='version', description='The version of the Dubbo service.', example='1.0.0'),
          }
        ](name='DubboRules', description='The canary release rule of the Dubbo service.'),
        greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule.', example='1'),
        name?: string(name='Name', description='The name of the canary release rule.', example='rule-name'),
        scRules?: [ 
          {
            condition?: string(name='condition', description='The relationship between the conditions in the canary release rule. Valid values:

*   **AND**: The conditions are in the logical AND relation. All conditions must be met at the same time.
*   **OR**: The conditions are in the logical OR relation. At least one of the conditions must be met.', example='OR'),
            items?: [ 
              {
                cond?: string(name='cond', description='The comparison operator. Valid values: **>**, **<**, **>=**, **<=**, **==**, and **! =**.', example='=='),
                expr?: string(name='expr', description='This parameter is not returned for Spring Cloud applications.', example='N/A'),
                index?: int32(name='index', description='This parameter is not returned for Spring Cloud applications.', example='N/A'),
                name?: string(name='name', description='The name of the parameter.', example='test'),
                operator?: string(name='operator', description='The operator. Valid values:

*   **rawvalue**: direct comparison.
*   **list**: whitelist.
*   **mod**: mods 100.
*   **deterministic_proportional_steaming_division**: percentage.', example='rawvalue'),
                type?: string(name='type', description='The type of the comparison. Valid values:

*   **param**: parameter
*   **cookie**: cookie
*   **header**: header', example='cookie'),
                value?: string(name='value', description='The value of the parameter. This value is compared with the value that is obtained based on the **type** and **name** parameters.', example='test'),
              }
            ](name='items', description='The conditions.'),
            path?: string(name='path', description='The path of the canary release rule of the Spring Cloud application.', example='/path'),
          }
        ](name='ScRules', description='The canary release rule of the Spring Cloud application.'),
        updateTime?: long(name='UpdateTime', description='The timestamp when the canary release rule was updated. Unit: milliseconds.', example='1609434061000'),
      }
    ](name='Result', description='The returned result.'),
    totalSize?: long(name='TotalSize', description='The total number of canary release rules. Valid value: **1**.', example='1'),
  }(name='Data', description='The information about the canary release rule.'),
  errorCode?: string(name='ErrorCode', description='The returned error code. Valid values:

- If the call is successful, the **ErrorCode** parameter is not returned.
- If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.'),
  message?: string(name='Message', description='The returned information. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9D29CBD0-45D3-410B-9826-52F86F90****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

- **true**: The information was queried.
- **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model ListGreyTagRouteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGreyTagRouteResponseBody(name='body'),
}

/**
 * @summary Queries the details of a canary release rule based on an application ID.
 *
 * @description >  You can configure only one canary release rule for each application.
 *
 * @param request ListGreyTagRouteRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGreyTagRouteResponse
 */
async function listGreyTagRouteWithOptions(request: ListGreyTagRouteRequest, headers: map[string]string, runtime: $RuntimeOptions): ListGreyTagRouteResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListGreyTagRoute',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/tagroute/greyTagRouteList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a canary release rule based on an application ID.
 *
 * @description >  You can configure only one canary release rule for each application.
 *
 * @param request ListGreyTagRouteRequest
 * @return ListGreyTagRouteResponse
 */
async function listGreyTagRoute(request: ListGreyTagRouteRequest): ListGreyTagRouteResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listGreyTagRouteWithOptions(request, headers, runtime);
}

model ListIngressesRequest {
  appId?: string(name='AppId', description='The ID of an application.', example='bbf3a590-6d13-46fe-8ca9-c947a20b****'),
  namespaceId?: string(name='NamespaceId', description='The ID of a namespace.

This parameter is required.', example='cn-beijing'),
}

model ListIngressesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    ingressList?: [ 
      {
        certId?: string(name='CertId', description='The ID of the certificate that is associated with a Classic Load Balancer (**CLB**) instance.', example='13624*****73809_16f8e549a20_1175189789_12****3210'),
        certIds?: string(name='CertIds', description='The ID of the certificate that is associated with an Application Load Balancer **ALB** instance.', example='87***35-cn-hangzhou,812***3-cn-hangzhou'),
        corsConfig?: {
          allowCredentials?: string(name='AllowCredentials'),
          allowHeaders?: string(name='AllowHeaders'),
          allowMethods?: string(name='AllowMethods'),
          allowOrigin?: string(name='AllowOrigin'),
          enable?: string(name='Enable'),
          exposeHeaders?: string(name='ExposeHeaders'),
          maxAge?: string(name='MaxAge'),
        }(name='CorsConfig'),
        createTime?: long(name='CreateTime'),
        defaultRule?: {
          appId?: string(name='AppId'),
          appName?: string(name='AppName'),
          backendProtocol?: string(name='BackendProtocol'),
          containerPort?: int32(name='ContainerPort'),
        }(name='DefaultRule'),
        description?: string(name='Description', description='The name of a routing rule.', example='test'),
        id?: long(name='Id', description='The ID of a routing rule.', example='18'),
        idleTimeout?: long(name='IdleTimeout'),
        listenerPort?: string(name='ListenerPort', description='The listener ports for an SLB instance.', example='80'),
        listenerProtocol?: string(name='ListenerProtocol', description='The protocol that is supported by SLB to forward requests. Valid values:

*   **HTTP**: HTTP is suitable for applications that need to identify the transmitted data.
*   **HTTPS**: HTTPS is suitable for applications that require encrypted data transmission.

This parameter is optional in the **CreateIngress** and **UpadateIngress** operations. If you do not configure this parameter when you call the CreateIngress or UpdateIngress operation to create or update a gateway routing rule, this parameter is not returned for the corresponding response.', example='HTTP'),
        loadBalanceType?: string(name='LoadBalanceType', description='The type of SLB instances. Valid values:

*   **clb**: Classic Load Balancer (formerly known as SLB).
*   **alb**: Application Load Balancer.', example='clb'),
        mseGatewayId?: string(name='MseGatewayId', description='The ID of an MSE cloud-native gateway.', example='gw-d5df01a1bae748f1a7c4e325d2fd****'),
        mseGatewayPort?: string(name='MseGatewayPort', description='The port of a service.', example='80'),
        mseGatewayProtocol?: string(name='MseGatewayProtocol', description='The protocol that is supported by an MSE cloud-native gateway to forward requests. Valid values:

*   **HTTP**: HTTP is suitable for applications that need to identify transmitted data.
*   **HTTPS**: HTTPS is suitable for applications that require encrypted data transmission.', example='HTTP'),
        name?: string(name='Name', description='The name of a routing rule.', example='lb-uf6jt0nu4z6ior943****-80-f5****'),
        namespaceId?: string(name='NamespaceId', description='The ID of a namespace.', example='cn-shanghai'),
        requestTimeout?: long(name='RequestTimeout'),
        rules?: [ 
          {
            appId?: string(name='AppId'),
            appName?: string(name='AppName'),
            backendProtocol?: string(name='BackendProtocol'),
            containerPort?: int32(name='ContainerPort'),
            domain?: string(name='Domain'),
            path?: string(name='Path'),
            rewritePath?: string(name='RewritePath'),
            ruleActions?: [ 
              {
                actionConfig?: string(name='ActionConfig'),
                actionType?: string(name='ActionType'),
              }
            ](name='RuleActions'),
          }
        ](name='Rules'),
        slbId?: string(name='SlbId', description='The ID of a Server Load Balancer (SLB) instance.', example='lb-uf62****6d13tq2u5'),
        slbType?: string(name='SlbType', description='The type of SLB instances. Valid values:

*   **internet**: an Internet-facing SLB instance
*   **intranet**: an Intranet-facing SLB instance', example='internet'),
      }
    ](name='IngressList', description='The list of routing rules.'),
  }(name='Data', description='The result returned.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Valid values:

*   **ErrorCode** is not returned if a request is successful.
*   **ErrorCode** is returned if a request failed. For more information, see **Error codes**.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   **success** is returned when a request is successful.
*   An error code is returned when a request failed.', example='success'),
  requestId?: string(name='RequestId', description='The ID of a request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of Ingresses was obtained. Valid values:

*   **true**: The list were obtained.
*   **false**: The list failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of a trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model ListIngressesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIngressesResponseBody(name='body'),
}

/**
 * @summary Use ListIngress API call to query Ingress list
 *
 * @param request ListIngressesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIngressesResponse
 */
async function listIngressesWithOptions(request: ListIngressesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListIngressesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListIngresses',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/ingress/IngressList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Use ListIngress API call to query Ingress list
 *
 * @param request ListIngressesRequest
 * @return ListIngressesResponse
 */
async function listIngresses(request: ListIngressesRequest): ListIngressesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listIngressesWithOptions(request, headers, runtime);
}

model ListJobsRequest {
  appName?: string(name='AppName', description='The name of the job template.', example='demo-app'),
  currentPage?: int32(name='CurrentPage', description='The number of the page to return. The parameter value is a positive integer that is greater than or equal to 1.', example='1'),
  fieldType?: string(name='FieldType', description='The dimension by which applications are filtered. Valid values:

*   **appName**: Applications are filtered by job template name.
*   **appIds**: Applications are filtered by job template ID.', example='appName'),
  fieldValue?: string(name='FieldValue', description='Enter the name and ID of the job template.', example='demo-app'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-beijing:demo'),
  orderBy?: string(name='OrderBy', description='Specifies how applications are sorted. Valid values:

*   **running**: The applications are sorted based on the number of running instances.
*   **instances**: The applications are sorted based on the number of destination instances.', example='running'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid value: 0 to 200.', example='20'),
  reverse?: boolean(name='Reverse', description='Specifies whether to sort the field names that are passed by **OrderBy** in ascending order. Valid values:

*   **true**: in ascending order
*   **false**: in descending order', example='true'),
  tags?: string(name='Tags', description='The tags that are displayed in a JSON string. Valid values:

*   **key**: the tag key
*   **value**: the tag value', example='[{"key":"key","value":"value"}]'),
  workload?: string(name='Workload', description='Set the value to `job`.', example='job'),
}

model ListJobsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  currentPage?: int32(name='CurrentPage', description='The page number of the returned page.', example='1'),
  data?: {
    applications?: [ 
      {
        active?: long(name='Active', description='The number of running instances.', example='0'),
        appDescription?: string(name='AppDescription', description='The description of the job template.', example='description'),
        appId?: string(name='AppId', description='The ID of the job template.', example='f7730764-d88f-4b9a-8d8e-cd8efbfe****'),
        appName?: string(name='AppName', description='The name of the job template.', example='demo-app'),
        completionTime?: long(name='CompletionTime', description='The time when the job was last completed.', example='1657522839'),
        cpu?: int32(name='Cpu', description='The CPU specifications that are required for each instance. Unit: millicores. This parameter cannot be set to 0. Valid values:

*   **500**
*   **1000**
*   **2000**
*   **4000**
*   **8000**
*   **16000**
*   **32000**', example='500'),
        failed?: long(name='Failed', description='The number of instances that failed to run.', example='0'),
        lastChangeorderState?: string(name='LastChangeorderState', description='Indicates whether the latest change order was executed. Valid values:

*   **0**: The latest change order failed to be executed.
*   **1**: The latest change order was executed.', example='1'),
        lastJobState?: string(name='LastJobState', description='The status of the latest job. Valid values:

*   **0**: The job is not executed.
*   **1**: The job was executed.
*   **2**: The job failed to be executed.
*   **3**: The job is being executed.', example='0'),
        lastStartTime?: long(name='LastStartTime', description='The time when the job was last started.', example='1657522800'),
        mem?: int32(name='Mem', description='The size of memory that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:

*   This parameter is set to **1024** if the Cpu parameter is set to 500 or 1000.
*   This parameter is set to **2048** if the Cpu parameter is set to 500, 1000, or 2000.
*   This parameter is set to **4096** if the Cpu parameter is set to 1000, 2000, or 4000.
*   This parameter is set to **8192** if the Cpu parameter is set to 2000, 4000, or 8000.
*   This parameter is set to **12288** if the Cpu parameter is set to 12000.
*   This parameter is set to **16384** if the Cpu parameter is set to 4000, 8000, or 16000.
*   This parameter is set to **24576** if the Cpu parameter is set to 12000.
*   This parameter is set to **32768** if the Cpu parameter is set to 16000.
*   This parameter is set to **65536** if the Cpu parameter is set to 8000, 16000, or 32000.
*   This parameter is set to **131072** if the Cpu parameter is set to 32000.', example='1024'),
        message?: string(name='Message', description='The returned message.', example='success'),
        namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-beijing:demo'),
        regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
        succeeded?: long(name='Succeeded', description='The number of instances that were successfully run.', example='3'),
        suspend?: boolean(name='Suspend', description='Indicates whether the job template is suspended.', example='false'),
        tags?: [ 
          {
            key?: string(name='Key', description='The key of the tag.', example='key'),
            value?: string(name='Value', description='The value of the tag.', example='value'),
          }
        ](name='Tags', description='The tags of the job template.'),
        triggerConfig?: string(name='TriggerConfig'),
      }
    ](name='Applications', description='The job templates.'),
    currentPage?: int32(name='CurrentPage', description='The page number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='20'),
    totalSize?: int32(name='TotalSize', description='The total number of job templates.', example='2'),
  }(name='Data', description='The job templates.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, **ErrorCode** is not returned.
*   If the call fails, **ErrorCode** is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message.', example='success'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='20'),
  requestId?: string(name='RequestId', description='The request ID.', example='B4D805CA-926D-41B1-8E63-7AD0C1ED****'),
  success?: boolean(name='Success', description='Indicates whether the applications were obtained. Valid values:

*   **true**
*   **false**', example='true'),
  totalSize?: int32(name='TotalSize', description='The total number of job templates.', example='2'),
}

model ListJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobsResponseBody(name='body'),
}

/**
 * @summary Queries the information about job templates.
 *
 * @param request ListJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobsResponse
 */
async function listJobsWithOptions(request: ListJobsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListJobsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.fieldType)) {
    query['FieldType'] = request.fieldType;
  }
  if (!$isNull(request.fieldValue)) {
    query['FieldValue'] = request.fieldValue;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.reverse)) {
    query['Reverse'] = request.reverse;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!$isNull(request.workload)) {
    query['Workload'] = request.workload;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobs',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/listJobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about job templates.
 *
 * @param request ListJobsRequest
 * @return ListJobsResponse
 */
async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobsWithOptions(request, headers, runtime);
}

model ListLogConfigsRequest {
  appId?: string(name='AppId', description='10

This parameter is required.', example='56f77b65-788d-442a-9885-7f20d91f****'),
  currentPage?: int32(name='CurrentPage', description='The ID of the request.

This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='1

This parameter is required.', example='10'),
}

model ListLogConfigsResponseBody = {
  code?: string(name='Code', description='Indicates whether the logging configurations of an application were obtained. Valid values:

*   **true**: indicates that the configurations were obtained.
*   **false**: indicates that the configurations could not be obtained.', example='200'),
  data?: {
    currentPage?: int32(name='CurrentPage', description='The total number of returned entries.', example='1'),
    logConfigs?: [ 
      {
        configName?: string(name='ConfigName', description='The path of logs.', example='sae-1f240907a6faf58c653f09e81b7e****'),
        createTime?: string(name='CreateTime', description='The storage type of logs.', example='2019-08-29 17:18:00'),
        logDir?: string(name='LogDir', description='The path of the log file (log source).', example='/root/logs/hsf/hsf.log'),
        logType?: string(name='LogType', description='The ID of the region.', example='file_log'),
        regionId?: string(name='RegionId', description='The number of the returned page.', example='cn-beijing'),
        slsLogStore?: string(name='SlsLogStore', description='The time when the configuration was created.', example='sae-1f240907a6faf58c653f09e81b7e****'),
        slsProject?: string(name='SlsProject', description='The type of the log. Set this value to **file_log**.', example='sae-56f77b65-788d-442a-9885-7f20d91f****'),
        storeType?: string(name='StoreType', description='The ID of the Log Service project.', example='sls'),
      }
    ](name='LogConfigs', description='The details of the logging configuration.'),
    pageSize?: int32(name='PageSize', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='10'),
    totalSize?: int32(name='TotalSize', description='The number of entries returned on each page.', example='1'),
  }(name='Data', description='The logging configurations.'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. It can be used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The logging configurations.', example='ac1d5e2c15671581252413581d****'),
}

model ListLogConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLogConfigsResponseBody(name='body'),
}

/**
 * @summary Queries a list of application logs.
 *
 * @param request ListLogConfigsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLogConfigsResponse
 */
async function listLogConfigsWithOptions(request: ListLogConfigsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListLogConfigsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLogConfigs',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/log/listLogConfigs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of application logs.
 *
 * @param request ListLogConfigsRequest
 * @return ListLogConfigsResponse
 */
async function listLogConfigs(request: ListLogConfigsRequest): ListLogConfigsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listLogConfigsWithOptions(request, headers, runtime);
}

model ListNamespaceChangeOrdersRequest {
  coStatus?: string(name='CoStatus', description='2', example='2'),
  coType?: string(name='CoType', description='CoBatchStartApplication', example='CoBatchStartApplication'),
  currentPage?: int32(name='CurrentPage', description='1', example='1'),
  key?: string(name='Key', description='test', example='test'),
  namespaceId?: string(name='NamespaceId', description='cn-shanghai:test

This parameter is required.', example='cn-shanghai:test'),
  pageSize?: int32(name='PageSize', description='20', example='20'),
}

model ListNamespaceChangeOrdersResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    changeOrderList?: [ 
      {
        batchCount?: int32(name='BatchCount', description='The number of release batches.', example='1'),
        batchType?: string(name='BatchType', description='The mode in which the release batches are determined. Valid values:

*   **auto**: SAE automatically determines the release batches.
*   **manual**: You must manually determine the release batches.'),
        changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='7fa5c0-9ebb-4bb4-b383-1f885447****'),
        coType?: string(name='CoType', description='The type of the change order, which corresponds the **CoTypeCode** parameter.', example='msg.docker.app.actions.CoBatchStartApplication'),
        coTypeCode?: string(name='CoTypeCode', description='The code of the change order type. Valid values:

*   **CoBatchStartApplication**: starts multiple applications concurrently.
*   **CoBatchStopApplication**: stops multiple applications concurrently.', example='CoBatchStartApplication'),
        createTime?: string(name='CreateTime', description='The time when the change order was created.', example='2019-07-11 15:54:49'),
        createUserId?: string(name='CreateUserId', description='The ID of the user who created the change order.', example='test@aliyun.com'),
        description?: string(name='Description', description='The description of the change order.'),
        finishTime?: string(name='FinishTime', description='The time when the change order was completed.', example='2019-07-11 20:12:58'),
        groupId?: string(name='GroupId', description='The ID of the group.', example='c9ecd2-cf6c-46c3-9f20-525de202****'),
        namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-shanghai:test'),
        pipelines?: string(name='Pipelines', description='The information about release batches.', example='xxxx'),
        source?: string(name='Source', description='The source of the change order.', example='console'),
        status?: int32(name='Status', description='The status of the change order. Valid values:

*   **0**: The change order is being prepared.
*   **1**: The change order is being executed.
*   **2**: The change order was executed.
*   **3**: The change order could not be executed.
*   **6**: The change order was terminated.
*   **10**: The change order could not be executed due to a system exception.', example='2'),
        userId?: string(name='UserId', description='The ID of the user.', example='test_sae'),
      }
    ](name='ChangeOrderList', description='The list of change orders.'),
    currentPage?: int32(name='CurrentPage', description='The number of the returned page.', example='1'),
    pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='20'),
    totalSize?: int32(name='TotalSize', description='The total number of change orders.', example='32'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0bc3915638507554994370d****'),
  success?: boolean(name='Success', description='Indicates whether the list of change orders was obtained. Valid values:

*   **true**: indicates that the list was obtained.
*   **false**: indicates that the list could not be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It is used to query the details of a request.', example='0bc3915638507554994370d****'),
}

model ListNamespaceChangeOrdersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNamespaceChangeOrdersResponseBody(name='body'),
}

/**
 * @summary Queries a list of change orders in a namespace.
 *
 * @param request ListNamespaceChangeOrdersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNamespaceChangeOrdersResponse
 */
async function listNamespaceChangeOrdersWithOptions(request: ListNamespaceChangeOrdersRequest, headers: map[string]string, runtime: $RuntimeOptions): ListNamespaceChangeOrdersResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.coStatus)) {
    query['CoStatus'] = request.coStatus;
  }
  if (!$isNull(request.coType)) {
    query['CoType'] = request.coType;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListNamespaceChangeOrders',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/changeorder/listNamespaceChangeOrders`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of change orders in a namespace.
 *
 * @param request ListNamespaceChangeOrdersRequest
 * @return ListNamespaceChangeOrdersResponse
 */
async function listNamespaceChangeOrders(request: ListNamespaceChangeOrdersRequest): ListNamespaceChangeOrdersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listNamespaceChangeOrdersWithOptions(request, headers, runtime);
}

model ListNamespacedConfigMapsRequest {
  namespaceId?: string(name='NamespaceId', description='cn-hangzhou

This parameter is required.', example='cn-hangzhou'),
}

model ListNamespacedConfigMapsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the call was successful.
*   **3xx**: indicates that the call was redirected.
*   **4xx**: indicates that the call failed.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    configMaps?: [ 
      {
        configMapId?: long(name='ConfigMapId', description='The ID of the ConfigMap instance.', example='1'),
        createTime?: long(name='CreateTime', description='The time when the instance was created.', example='1593760185111'),
        data?: map[string]any(name='Data', description='The data of ConfigMap key-value pairs. Format:

{"k1":"v1", "k2":"v2"}

k specifies a key and v specifies a value. For more information, see [Manage and use configurations](https://help.aliyun.com/document_detail/171326.html).', example='{"k1":"v1","k2":"v2"}'),
        description?: string(name='Description', description='The description of the instance.', example='test-desc'),
        name?: string(name='Name', description='The name of the ConfigMap instance.', example='test-name'),
        namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-hangzhou'),
        relateApps?: [ 
          {
            appId?: string(name='AppId', description='The ID of the application.', example='f16b4000-9058-4c22-a49d-49a28f0b****'),
            appName?: string(name='AppName', description='The name of the application.', example='test-app'),
          }
        ](name='RelateApps', description='The application that is associated with the instance.'),
        updateTime?: long(name='UpdateTime', description='The time when the instance was last modified.', example='1593760185111'),
      }
    ](name='ConfigMaps', description='The ConfigMap instances.'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The returned error code. Valid values:

- If the call is successful, the **ErrorCode** parameter is not returned.
- If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.'),
  message?: string(name='Message', description='The returned information. Valid values:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the ConfigMap instances were obtained. Valid values:

*   **true**: The instances were obtained.
*   **false**: The instances failed to be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model ListNamespacedConfigMapsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNamespacedConfigMapsResponseBody(name='body'),
}

/**
 * @summary Queries the ConfigMap instances in a namespace.
 *
 * @param request ListNamespacedConfigMapsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNamespacedConfigMapsResponse
 */
async function listNamespacedConfigMapsWithOptions(request: ListNamespacedConfigMapsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListNamespacedConfigMapsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListNamespacedConfigMaps',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/configmap/listNamespacedConfigMaps`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the ConfigMap instances in a namespace.
 *
 * @param request ListNamespacedConfigMapsRequest
 * @return ListNamespacedConfigMapsResponse
 */
async function listNamespacedConfigMaps(request: ListNamespacedConfigMapsRequest): ListNamespacedConfigMapsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listNamespacedConfigMapsWithOptions(request, headers, runtime);
}

model ListPublishedServicesRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
}

model ListPublishedServicesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: [ 
    {
      appId?: string(name='AppId', description='The ID of the application.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
      group2Ip?: string(name='Group2Ip', description='The reserved parameter. This parameter does not take effect.', example='{}'),
      groups?: [ string ](name='Groups', description='The service group that corresponds to the consumed service.'),
      ips?: [ string ](name='Ips', description='The addresses where services can be subscribed to.'),
      name?: string(name='Name', description='The name of the published service.', example='com.alibaba.nodejs.ItemService'),
      type?: string(name='Type', description='The type of the published service.', example='RPC'),
      version?: string(name='Version', description='The version of the published services.', example='1.0.0'),
    }
  ](name='Data', description='The details of the microservices.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of microservices was queried. Valid values:

*   **true**: The list was queried.
*   **false**: The list failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model ListPublishedServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPublishedServicesResponseBody(name='body'),
}

/**
 * @summary Queries a list of microservices that are published.
 *
 * @param request ListPublishedServicesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPublishedServicesResponse
 */
async function listPublishedServicesWithOptions(request: ListPublishedServicesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListPublishedServicesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPublishedServices',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/service/listPublishedServices`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of microservices that are published.
 *
 * @param request ListPublishedServicesRequest
 * @return ListPublishedServicesResponse
 */
async function listPublishedServices(request: ListPublishedServicesRequest): ListPublishedServicesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listPublishedServicesWithOptions(request, headers, runtime);
}

model ListSecretsRequest {
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace in which the Secrets reside. By default, the namespace ID is the same as the region ID.

This parameter is required.', example='cn-beijing:test'),
}

model ListSecretsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    secrets?: [ 
      {
        createTime?: long(name='CreateTime', description='The time when the Secret was created.', example='1593760185111'),
        namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-beijing:test'),
        relateApps?: [ 
          {
            appId?: string(name='AppId', description='The application ID.', example='f16b4000-9058-4c22-a49d-49a28f0b****'),
            appName?: string(name='AppName', description='The application name.', example='test-app'),
          }
        ](name='RelateApps', description='The associated applications.'),
        secretId?: long(name='SecretId', description='The Secret ID.', example='16'),
        secretName?: string(name='SecretName', description='The Secret name.', example='registry-auth'),
        secretType?: string(name='SecretType', description='The Secret type.

Set the value to **kubernetes.io/dockerconfigjson**. The value indicates the secret for the username and password of the image repository and is used for authentication when images are pulled during application deployment.', example='kubernetes.io/dockerconfigjson'),
        updateTime?: long(name='UpdateTime', description='The time when the Secret was updated.', example='1593760185111'),
      }
    ](name='Secrets', description='The Secrets.'),
  }(name='Data', description='The data returned.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model ListSecretsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecretsResponseBody(name='body'),
}

/**
 * @summary Queries the information about Secrets in a namespace.
 *
 * @param request ListSecretsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecretsResponse
 */
async function listSecretsWithOptions(request: ListSecretsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListSecretsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSecrets',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/secret/secrets`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about Secrets in a namespace.
 *
 * @param request ListSecretsRequest
 * @return ListSecretsResponse
 */
async function listSecrets(request: ListSecretsRequest): ListSecretsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listSecretsWithOptions(request, headers, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='A maximum of 50 entries can be returned for a query. If a query generates more than 50 entries, the NextToken parameter is returned with the first 50 entries. You can use the NextToken parameter value to retrieve the subsequent entries that are not returned in the current query result.', example='A2RN'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-beijing'),
  resourceIds?: string(name='ResourceIds', description='The resource ID. Separate multiple resource IDs with comma (,). This parameter is required if you do not specify the **Tags** parameter.', example='["d42921c4-5433-4abd-8075-0e536f8b****"]'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to `application`.

This parameter is required.', example='application'),
  tags?: string(name='Tags', description='The tag in the format of a key-value pair. This parameter is required if you do not specify the **ResourceIds** parameter. The following parameters are involved:

*   **key**: the tag key. It cannot exceed 128 characters in length.
*   **value**: the tag value. It cannot exceed 128 characters in length.

Tag keys and tag values are case-sensitive. If you specify multiple tags, the system adds all the tags to the specified resources. Each tag key on a resource can have only one tag value. If you create a tag that has the same key as an existing tag, the value of the existing tag is overwritten.

Tag keys and tag values cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='[{"key":"k1","value":"v1"}]'),
}

model ListTagResourcesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    nextToken?: string(name='NextToken', description='A maximum of 50 entries can be returned for a query. If a query generates more than 50 entries, the NextToken parameter is returned with the first 50 entries. You can use the NextToken parameter value to retrieve the subsequent entries that are not returned in the current query result.', example='""'),
    tagResources?: [ 
      {
        resourceId?: string(name='ResourceId', description='The ID of the application.', example='d42921c4-5433-4abd-8075-0e536f8b****'),
        resourceType?: string(name='ResourceType', description='The type of the resource. Valid value: `application`.', example='ALIYUN::SAE::APPLICATION'),
        tagKey?: string(name='TagKey', description='The key of the tag.', example='k1'),
        tagValue?: string(name='TagValue', description='The value of the tag.', example='v1'),
      }
    ](name='TagResources', description='The mapping relationships between applications and tags.'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='7414187F-4F59-4585-9BCF-5F0804E4****'),
  success?: boolean(name='Success', description='Indicates whether the mapping relationships between applications and tags were queried. Valid values:

*   **true**: The mapping relationships were queried.
*   **false**: The mapping relationships failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0bc5f84e15916043198032146d****'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the mapping relationships between applications and tags.
 *
 * @param request ListTagResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/tags`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the mapping relationships between applications and tags.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listTagResourcesWithOptions(request, headers, runtime);
}

model ListWebApplicationInstancesRequest {
  endTime?: long(name='EndTime', description='The time when the operation ended.', example='1715567192'),
  instanceIds?: [ string ](name='InstanceIds', description='The instance ID.', example='c-667d143a-17b4e0fa-46d3a2******'),
  limit?: string(name='Limit', description='The number of application instances returned.', example='10'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The time when the task was created.', example='1562831689704'),
  statuses?: [ string ](name='Statuses', description='The status of the application instance.'),
  versionIds?: [ string ](name='VersionIds', description='The ID of the application version.', example='001'),
}

model ListWebApplicationInstancesShrinkRequest {
  endTime?: long(name='EndTime', description='The time when the operation ended.', example='1715567192'),
  instanceIdsShrink?: string(name='InstanceIds', description='The instance ID.', example='c-667d143a-17b4e0fa-46d3a2******'),
  limit?: string(name='Limit', description='The number of application instances returned.', example='10'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='The time when the task was created.', example='1562831689704'),
  statusesShrink?: string(name='Statuses', description='The status of the application instance.'),
  versionIdsShrink?: string(name='VersionIds', description='The ID of the application version.', example='001'),
}

model ListWebApplicationInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebApplicationInstancesBody  
}

/**
 * @summary Query the list of web application instances.
 *
 * @description Query the list of web application instances.
 *
 * @param tmpReq ListWebApplicationInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWebApplicationInstancesResponse
 */
async function listWebApplicationInstancesWithOptions(ApplicationId: string, tmpReq: ListWebApplicationInstancesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListWebApplicationInstancesResponse {
  tmpReq.validate();
  var request = new ListWebApplicationInstancesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.instanceIds)) {
    request.instanceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceIds, 'InstanceIds', 'json');
  }
  if (!$isNull(tmpReq.statuses)) {
    request.statusesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.statuses, 'Statuses', 'json');
  }
  if (!$isNull(tmpReq.versionIds)) {
    request.versionIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.versionIds, 'VersionIds', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceIdsShrink)) {
    query['InstanceIds'] = request.instanceIdsShrink;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!$isNull(request.statusesShrink)) {
    query['Statuses'] = request.statusesShrink;
  }
  if (!$isNull(request.versionIdsShrink)) {
    query['VersionIds'] = request.versionIdsShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWebApplicationInstances',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications-observability/${$URL.percentEncode(ApplicationId)}/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the list of web application instances.
 *
 * @description Query the list of web application instances.
 *
 * @param request ListWebApplicationInstancesRequest
 * @return ListWebApplicationInstancesResponse
 */
async function listWebApplicationInstances(ApplicationId: string, request: ListWebApplicationInstancesRequest): ListWebApplicationInstancesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listWebApplicationInstancesWithOptions(ApplicationId, request, headers, runtime);
}

model ListWebApplicationRevisionsRequest {
  limit?: int32(name='Limit', description='The number of applications returned.', example='10'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='A2RN'),
}

model ListWebApplicationRevisionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebApplicationRevisionsBody  
}

/**
 * @summary Query the list of web application versions.
 *
 * @description Query the list of web application versions.
 *
 * @param request ListWebApplicationRevisionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWebApplicationRevisionsResponse
 */
async function listWebApplicationRevisionsWithOptions(ApplicationId: string, request: ListWebApplicationRevisionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListWebApplicationRevisionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWebApplicationRevisions',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-revisions/${$URL.percentEncode(ApplicationId)}/revisions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the list of web application versions.
 *
 * @description Query the list of web application versions.
 *
 * @param request ListWebApplicationRevisionsRequest
 * @return ListWebApplicationRevisionsResponse
 */
async function listWebApplicationRevisions(ApplicationId: string, request: ListWebApplicationRevisionsRequest): ListWebApplicationRevisionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listWebApplicationRevisionsWithOptions(ApplicationId, request, headers, runtime);
}

model ListWebApplicationsRequest {
  limit?: int32(name='Limit', description='The number of applications returned.', example='10'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-beijing:test'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='MTIzNCNhYmM'),
  prefix?: string(name='Prefix', description='The prefix of the application name.', example='my-application'),
}

model ListWebApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebApplicationsBody  
}

/**
 * @summary Query the list of web applications.
 *
 * @description Call the ListWebApplications operation to query the list of web applications.
 *
 * @param request ListWebApplicationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWebApplicationsResponse
 */
async function listWebApplicationsWithOptions(request: ListWebApplicationsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListWebApplicationsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.prefix)) {
    query['Prefix'] = request.prefix;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWebApplications',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the list of web applications.
 *
 * @description Call the ListWebApplications operation to query the list of web applications.
 *
 * @param request ListWebApplicationsRequest
 * @return ListWebApplicationsResponse
 */
async function listWebApplications(request: ListWebApplicationsRequest): ListWebApplicationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listWebApplicationsWithOptions(request, headers, runtime);
}

model ListWebCustomDomainsRequest {
  applicationId?: string(name='ApplicationId', description='The application ID.', example='7e41aff0-9eca-45c9-ac48-675e09******'),
  limit?: int32(name='Limit', description='The number of custom domain names returned.', example='10'),
  namespaceId?: string(name='NamespaceId', description='The namespace ID.', example='cn-hangzhou'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='A2RN'),
  prefix?: string(name='Prefix', description='The prefix of the custom domain name that you want to query.', example='remoteresult'),
}

model ListWebCustomDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWebCustomDomainBody  
}

/**
 * @summary Query available custom domain names.
 *
 * @description Query available custom domain names.
 *
 * @param request ListWebCustomDomainsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWebCustomDomainsResponse
 */
async function listWebCustomDomainsWithOptions(request: ListWebCustomDomainsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListWebCustomDomainsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.applicationId)) {
    query['ApplicationId'] = request.applicationId;
  }
  if (!$isNull(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.prefix)) {
    query['Prefix'] = request.prefix;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListWebCustomDomains',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/custom-domains`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query available custom domain names.
 *
 * @description Query available custom domain names.
 *
 * @param request ListWebCustomDomainsRequest
 * @return ListWebCustomDomainsResponse
 */
async function listWebCustomDomains(request: ListWebCustomDomainsRequest): ListWebCustomDomainsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listWebCustomDomainsWithOptions(request, headers, runtime);
}

model OpenSaeServiceResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='20485646575****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='559B4247-C41C-4D9E-B866-B55D378B****'),
}

model OpenSaeServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenSaeServiceResponseBody(name='body'),
}

/**
 * @summary Activates the Serverless App Engine (SAE) service for free.
 *
 * @description > Make sure that your account balance is greater than 0. Otherwise, the SAE service cannot be activated.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenSaeServiceResponse
 */
async function openSaeServiceWithOptions(headers: map[string]string, runtime: $RuntimeOptions): OpenSaeServiceResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'OpenSaeService',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/service/open`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Activates the Serverless App Engine (SAE) service for free.
 *
 * @description > Make sure that your account balance is greater than 0. Otherwise, the SAE service cannot be activated.
 *
 * @return OpenSaeServiceResponse
 */
async function openSaeService(): OpenSaeServiceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return openSaeServiceWithOptions(headers, runtime);
}

model PublishWebApplicationRevisionRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-shanghai'),
  body?: PublishWebApplicationRevisionInput(name='body', description='The configurations of the version.

This parameter is required.'),
}

model PublishWebApplicationRevisionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationRevisionBody  
}

/**
 * @summary Publish a web application version.
 *
 * @description Publish a web application version. You can change the configurations of the version and create a new version.
 *
 * @param request PublishWebApplicationRevisionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishWebApplicationRevisionResponse
 */
async function publishWebApplicationRevisionWithOptions(ApplicationId: string, request: PublishWebApplicationRevisionRequest, headers: map[string]string, runtime: $RuntimeOptions): PublishWebApplicationRevisionResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'PublishWebApplicationRevision',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-revisions/${$URL.percentEncode(ApplicationId)}/revisions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Publish a web application version.
 *
 * @description Publish a web application version. You can change the configurations of the version and create a new version.
 *
 * @param request PublishWebApplicationRevisionRequest
 * @return PublishWebApplicationRevisionResponse
 */
async function publishWebApplicationRevision(ApplicationId: string, request: PublishWebApplicationRevisionRequest): PublishWebApplicationRevisionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return publishWebApplicationRevisionWithOptions(ApplicationId, request, headers, runtime);
}

model QueryResourceStaticsRequest {
  appId?: string(name='AppId', description='7171a6ca-d1cd-4928-8642-7d5cfe69\\\\*\\\\*\\\\*\\\\*

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
}

model QueryResourceStaticsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: {
    realTimeRes?: {
      cpu?: float(name='Cpu', description='The CPU usage. Unit: core per minute.', example='13'),
      ephemeralStorage?: float(name='EphemeralStorage'),
      memory?: float(name='Memory', description='The memory usage. Unit: GiB per minute.', example='26'),
    }(name='RealTimeRes', description='The real-time resource usage.'),
    summary?: {
      activeCpu?: float(name='ActiveCpu'),
      cpu?: float(name='Cpu', description='The CPU usage. Unit: core per minute.', example='3354'),
      cu?: float(name='Cu'),
      ephemeralStorage?: float(name='EphemeralStorage'),
      idleCpu?: float(name='IdleCpu'),
      memory?: float(name='Memory', description='The memory usage. Unit: GiB per minute.', example='6708'),
    }(name='Summary', description='The resource usage of the current month.'),
  }(name='Data', description='The resource usage.'),
  errorCode?: string(name='ErrorCode', description='The error code. 

- The **ErrorCode** parameter is not returned when the request succeeds.
- The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7CCF7092-72CA-4431-90D6-C7D98752****'),
  success?: boolean(name='Success', description='Indicates whether the resource usage of an application was obtained. Valid values:

*   **true**: indicates that the resource usage was obtained.
*   **false**: indicates that the resource usage could not be obtained.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It can be used to query the details of a request.', example='ac1a08a015623098794277264e****'),
}

model QueryResourceStaticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResourceStaticsResponseBody(name='body'),
}

/**
 * @summary Queries the resource usage of an application.
 *
 * @param request QueryResourceStaticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryResourceStaticsResponse
 */
async function queryResourceStaticsWithOptions(request: QueryResourceStaticsRequest, headers: map[string]string, runtime: $RuntimeOptions): QueryResourceStaticsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'QueryResourceStatics',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/quota/queryResourceStatics`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource usage of an application.
 *
 * @param request QueryResourceStaticsRequest
 * @return QueryResourceStaticsResponse
 */
async function queryResourceStatics(request: QueryResourceStaticsRequest): QueryResourceStaticsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return queryResourceStaticsWithOptions(request, headers, runtime);
}

model ReduceApplicationCapacityByInstanceIdsRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  instanceIds?: string(name='InstanceIds', description='The ID of the instance. Separate multiple instances with commas (,).

This parameter is required.', example='b2a8a925-477a-4ed7-b825-d5e22500****'),
}

model ReduceApplicationCapacityByInstanceIdsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change process.', example='76fa5c0-9ebb-4bb4-b383-1f885447****'),
  }(name='Data', description='The information about the change process.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A8E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Take note of the following rules:

*   **true**: The information was queried.
*   **false**: The image failed to be found.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model ReduceApplicationCapacityByInstanceIdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReduceApplicationCapacityByInstanceIdsResponseBody(name='body'),
}

/**
 * @summary Reduces capacity by instance IDs.
 *
 * @param request ReduceApplicationCapacityByInstanceIdsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReduceApplicationCapacityByInstanceIdsResponse
 */
async function reduceApplicationCapacityByInstanceIdsWithOptions(request: ReduceApplicationCapacityByInstanceIdsRequest, headers: map[string]string, runtime: $RuntimeOptions): ReduceApplicationCapacityByInstanceIdsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReduceApplicationCapacityByInstanceIds',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/ScaleInApplicationWithInstanceIds`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Reduces capacity by instance IDs.
 *
 * @param request ReduceApplicationCapacityByInstanceIdsRequest
 * @return ReduceApplicationCapacityByInstanceIdsResponse
 */
async function reduceApplicationCapacityByInstanceIds(request: ReduceApplicationCapacityByInstanceIdsRequest): ReduceApplicationCapacityByInstanceIdsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return reduceApplicationCapacityByInstanceIdsWithOptions(request, headers, runtime);
}

model RescaleApplicationRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  autoEnableApplicationScalingRule?: boolean(name='AutoEnableApplicationScalingRule', description='Specifies whether to automatically enable an auto scaling policy for the application. Take note of the following rules:

*   **true**: turns on Logon-free Sharing
*   **false**: turns off Logon-free Sharing', example='true'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. Default value: -1.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

> When **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of MinReadyInstanceRatio** takes precedence.**** For example, if **MinReadyInstances** is set to **5, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Special values:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
  replicas?: int32(name='Replicas', description='The expected number of instances.

This parameter is required.', example='5'),
}

model RescaleApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='0e09829f-4914-4612-bc88-6f52fd81****'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application is successfully scaled. Take note of the following rules:

*   **true**
*   **false**', example='true'),
}

model RescaleApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RescaleApplicationResponseBody(name='body'),
}

/**
 * @summary Scales an application.
 *
 * @param request RescaleApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RescaleApplicationResponse
 */
async function rescaleApplicationWithOptions(request: RescaleApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): RescaleApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.autoEnableApplicationScalingRule)) {
    query['AutoEnableApplicationScalingRule'] = request.autoEnableApplicationScalingRule;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RescaleApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/rescaleApplication`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Scales an application.
 *
 * @param request RescaleApplicationRequest
 * @return RescaleApplicationResponse
 */
async function rescaleApplication(request: RescaleApplicationRequest): RescaleApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return rescaleApplicationWithOptions(request, headers, runtime);
}

model RescaleApplicationVerticallyRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  cpu?: string(name='Cpu', description='The destination CPU specification. Unit: millicore.

This parameter is required.', example='1000'),
  diskSize?: string(name='DiskSize'),
  memory?: string(name='Memory', description='The destination memory size. Unit: MB.

This parameter is required.', example='2048'),
  autoEnableApplicationScalingRule?: boolean(name='autoEnableApplicationScalingRule'),
  minReadyInstanceRatio?: int32(name='minReadyInstanceRatio'),
  minReadyInstances?: int32(name='minReadyInstances'),
}

model RescaleApplicationVerticallyResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='ffd8cd45-2b5f-415d-b4d0-1003e80b****'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   The **ErrorCode** parameter is returned if the request fails. For more information, see the **Error codes** section in this topic.', example='Null'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AB521DBB-FA78-42E6-803F-A862EA4F****'),
  success?: boolean(name='Success', description='Indicates whether the instance specifications are changed. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0bc3b6f315637273629117900d****'),
}

model RescaleApplicationVerticallyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RescaleApplicationVerticallyResponseBody(name='body'),
}

/**
 * @summary Changes the instance specifications of an application.
 *
 * @param request RescaleApplicationVerticallyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RescaleApplicationVerticallyResponse
 */
async function rescaleApplicationVerticallyWithOptions(request: RescaleApplicationVerticallyRequest, headers: map[string]string, runtime: $RuntimeOptions): RescaleApplicationVerticallyResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.cpu)) {
    query['Cpu'] = request.cpu;
  }
  if (!$isNull(request.diskSize)) {
    query['DiskSize'] = request.diskSize;
  }
  if (!$isNull(request.memory)) {
    query['Memory'] = request.memory;
  }
  if (!$isNull(request.autoEnableApplicationScalingRule)) {
    query['autoEnableApplicationScalingRule'] = request.autoEnableApplicationScalingRule;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['minReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['minReadyInstances'] = request.minReadyInstances;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RescaleApplicationVertically',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/rescaleApplicationVertically`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the instance specifications of an application.
 *
 * @param request RescaleApplicationVerticallyRequest
 * @return RescaleApplicationVerticallyResponse
 */
async function rescaleApplicationVertically(request: RescaleApplicationVerticallyRequest): RescaleApplicationVerticallyResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return rescaleApplicationVerticallyWithOptions(request, headers, runtime);
}

model RestartApplicationRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  autoEnableApplicationScalingRule?: boolean(name='AutoEnableApplicationScalingRule'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. Default value: -1.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

> When **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of \\\\*\\\\*MinReadyInstanceRatio** takes precedence.**** For example, if **MinReadyInstances** is set to **5\\\\*\\\\*, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Special values:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
}

model RestartApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change process.', example='4a815998-b468-4bea-b7d8-59f52a44****'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the instance is successfully restarted. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model RestartApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartApplicationResponseBody(name='body'),
}

/**
 * @summary Restarts an application.
 *
 * @param request RestartApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartApplicationResponse
 */
async function restartApplicationWithOptions(request: RestartApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): RestartApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.autoEnableApplicationScalingRule)) {
    query['AutoEnableApplicationScalingRule'] = request.autoEnableApplicationScalingRule;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/restartApplication`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Restarts an application.
 *
 * @param request RestartApplicationRequest
 * @return RestartApplicationResponse
 */
async function restartApplication(request: RestartApplicationRequest): RestartApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return restartApplicationWithOptions(request, headers, runtime);
}

model RestartInstancesRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='1daa7236-3844-4f36-b39a-605b0cc0****'),
  instanceIds?: string(name='InstanceIds', description='The ID of the instance to be restarted. Separate multiple instance IDs with commas (,).

This parameter is required.', example='mysae-1daa7236-3844-4f36-b39a-605b0cc0caa6-*****'),
}

model RestartInstancesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='5afa5b98-0c64-4637-983f-15eaa888****'),
  }(name='Data', description='The details of the application.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Take note of the following rules:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Specifies whether the instances are successfully restarted. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model RestartInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartInstancesResponseBody(name='body'),
}

/**
 * @summary Restarts one or more instances in an application.
 *
 * @param request RestartInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartInstancesResponse
 */
async function restartInstancesWithOptions(request: RestartInstancesRequest, headers: map[string]string, runtime: $RuntimeOptions): RestartInstancesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartInstances',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/restartInstances`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Restarts one or more instances in an application.
 *
 * @param request RestartInstancesRequest
 * @return RestartInstancesResponse
 */
async function restartInstances(request: RestartInstancesRequest): RestartInstancesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return restartInstancesWithOptions(request, headers, runtime);
}

model RollbackApplicationRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  autoEnableApplicationScalingRule?: string(name='AutoEnableApplicationScalingRule', description='Specifies whether to automatically enable an auto scaling policy for the application. Take note of the following rules:

*   **true**: turns on Logon-free Sharing
*   **false**: turns off Logon-free Sharing', example='true'),
  batchWaitTime?: int32(name='BatchWaitTime', description='The wait time between batches. Unit: seconds.', example='10'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. Default value: -1.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if the percentage is set to **50**% and five instances are available, the minimum number of available instances is 3.

> When both **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of **MinReadyInstanceRatio** takes precedence.** For example, if **MinReadyInstances** is set to **5, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Take note of the following rules:

*   If you set the value to **0**, business interruptions occur when the application is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='1'),
  updateStrategy?: string(name='UpdateStrategy', description='The deployment policy. If the minimum number of available instances is 1, the value of the **UpdateStrategy** parameter is an empty string (""). If the minimum number of available instances is larger than 1, specify this parameter based on your requirements. Examples:

*   Perform canary release for one instance and release the remaining instances in two batches automatically with a one-minute interval between the deployment of each instance:

    `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}`

*   Perform canary release for one instance and release the remaining instances in two batches manually:

    `{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"manual"},"grayUpdate":{"gray":1}}`

*   Release the instances in two batches automatically with no interval between the deployment of each instance:

    `{"type":"BatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":0}}`

The following table describes the parameters that are used in the preceding statements.

*   **type**: the type of the release policy. Valid values: **GrayBatchUpdate** and **BatchUpdate**.

*   **batchUpdate**: the phased release policy.

    *   **batch**: the number of release batches.
    *   **releaseType**: the processing method for the batches. Valid values: **auto** and **manual**.
    *   **batchWaitTime**: the interval between release batches. Unit: seconds.

*   **grayUpdate**: the number of release batches in the phased release after a canary release. This parameter is returned only if the **type** parameter is set to **GrayBatchUpdate**.', example='{"type":"GrayBatchUpdate","batchUpdate":{"batch":2,"releaseType":"auto","batchWaitTime":1},"grayUpdate":{"gray":1}}'),
  versionId?: string(name='VersionId', description='The ID of the application version. Call the [ListAppVersions](https://help.aliyun.com/document_detail/162054.html) operation to obtain the version ID.

This parameter is required.', example='0026ff7f-2b57-4127-bdd0-9bf202bb9****'),
}

model RollbackApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Take note of the following rules:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change process.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
    isNeedApproval?: boolean(name='IsNeedApproval', description='Specifies whether approval is required when a RAM user performs release. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned if the request failed. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the application is successfully rolled back. Take note of the following rules:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model RollbackApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RollbackApplicationResponseBody(name='body'),
}

/**
 * @summary Rolls back an application.
 *
 * @param request RollbackApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RollbackApplicationResponse
 */
async function rollbackApplicationWithOptions(request: RollbackApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): RollbackApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.autoEnableApplicationScalingRule)) {
    query['AutoEnableApplicationScalingRule'] = request.autoEnableApplicationScalingRule;
  }
  if (!$isNull(request.batchWaitTime)) {
    query['BatchWaitTime'] = request.batchWaitTime;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }
  if (!$isNull(request.updateStrategy)) {
    query['UpdateStrategy'] = request.updateStrategy;
  }
  if (!$isNull(request.versionId)) {
    query['VersionId'] = request.versionId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RollbackApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/rollbackApplication`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Rolls back an application.
 *
 * @param request RollbackApplicationRequest
 * @return RollbackApplicationResponse
 */
async function rollbackApplication(request: RollbackApplicationRequest): RollbackApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return rollbackApplicationWithOptions(request, headers, runtime);
}

model StartApplicationRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
}

model StartApplicationResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order.', example='4a815998-b468-4bea-b7d8-59f52a44****'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, **ErrorCode** is not returned.
*   If the call fails, **ErrorCode** is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BD8F4C7-D84C-4D46-9885-8212997E****'),
  success?: boolean(name='Success', description='Indicates whether the application is started. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0bc3b6e215637275918588187d****'),
}

model StartApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartApplicationResponseBody(name='body'),
}

/**
 * @summary Starts an application.
 *
 * @param request StartApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartApplicationResponse
 */
async function startApplicationWithOptions(request: StartApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): StartApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/startApplication`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Starts an application.
 *
 * @param request StartApplicationRequest
 * @return StartApplicationResponse
 */
async function startApplication(request: StartApplicationRequest): StartApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return startApplicationWithOptions(request, headers, runtime);
}

model StartWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
}

model StartWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Start a web application.
 *
 * @description Call the StartWebApplication operation to start a web application.
 *
 * @param request StartWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartWebApplicationResponse
 */
async function startWebApplicationWithOptions(ApplicationId: string, request: StartWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): StartWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-ops/${$URL.percentEncode(ApplicationId)}/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Start a web application.
 *
 * @description Call the StartWebApplication operation to start a web application.
 *
 * @param request StartWebApplicationRequest
 * @return StartWebApplicationResponse
 */
async function startWebApplication(ApplicationId: string, request: StartWebApplicationRequest): StartWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return startWebApplicationWithOptions(ApplicationId, request, headers, runtime);
}

model StopApplicationRequest {
  appId?: string(name='AppId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
}

model StopApplicationResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='4a815998-b468-4bea-b7d8-59f52a44****'),
  }(name='Data', description='The error code.

*   If the request is successful, this parameter is not returned.****
*   This parameter is returned only if the request failed.**** For more information, see **Error codes** in this topic.'),
  errorCode?: string(name='ErrorCode', description='Indicates whether the specified application is stopped. Valid values:

*   **true**
*   **false**'),
  message?: string(name='Message', description='The returned data.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the trace. It can be used to query the details of a request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The ID of the change order.', example='0bc3b6e215637275918588187d****'),
}

model StopApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopApplicationResponseBody(name='body'),
}

/**
 * @summary 0099b7be-5f5b-4512-a7fc-56049ef1\\*\\*\\*\\*
 *
 * @param request StopApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopApplicationResponse
 */
async function stopApplicationWithOptions(request: StopApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): StopApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/stopApplication`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 0099b7be-5f5b-4512-a7fc-56049ef1\\*\\*\\*\\*
 *
 * @param request StopApplicationRequest
 * @return StopApplicationResponse
 */
async function stopApplication(request: StopApplicationRequest): StopApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return stopApplicationWithOptions(request, headers, runtime);
}

model StopWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
}

model StopWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Stop a web application.
 *
 * @description Call the StopWebApplication operation to stop a web application.
 *
 * @param request StopWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopWebApplicationResponse
 */
async function stopWebApplicationWithOptions(ApplicationId: string, request: StopWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): StopWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-ops/${$URL.percentEncode(ApplicationId)}/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stop a web application.
 *
 * @description Call the StopWebApplication operation to stop a web application.
 *
 * @param request StopWebApplicationRequest
 * @return StopWebApplicationResponse
 */
async function stopWebApplication(ApplicationId: string, request: StopWebApplicationRequest): StopWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return stopWebApplicationWithOptions(ApplicationId, request, headers, runtime);
}

model SuspendJobRequest {
  appId?: string(name='AppId', description='The ID of the job template.

This parameter is required.', example='ee1a7a07-abcb-4652-a1d3-2d57f415****'),
  suspend?: boolean(name='Suspend', description='Specifies whether to suspend the job template.

This parameter is required.', example='true'),
}

model SuspendJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: string(name='Data', description='Whether the execution is successful.', example='{success: true}'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Valid values:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see **Error codes** in this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='67DD9A98-9CCC-5BE8-8C9E-B45E72F4****'),
  success?: boolean(name='Success', description='Indicates whether the job was executed. Valid values:

*   **true**: The job was executed.
*   **false**: The job failed to be executed.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0b87b7e716575071334387401e****'),
}

model SuspendJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SuspendJobResponseBody(name='body'),
}

/**
 * @summary Suspends a job.
 *
 * @param request SuspendJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SuspendJobResponse
 */
async function suspendJobWithOptions(request: SuspendJobRequest, headers: map[string]string, runtime: $RuntimeOptions): SuspendJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.suspend)) {
    query['Suspend'] = request.suspend;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SuspendJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/suspendJob`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Suspends a job.
 *
 * @param request SuspendJobRequest
 * @return SuspendJobResponse
 */
async function suspendJob(request: SuspendJobRequest): SuspendJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return suspendJobWithOptions(request, headers, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='application', example='cn-beijing'),
  resourceIds?: string(name='ResourceIds', description='The ID of the request.

This parameter is required.', example='["d42921c4-5433-4abd-8075-0e536f8b****"]'),
  resourceType?: string(name='ResourceType', description='[{"key":"k1","value":"v1"}]

This parameter is required.', example='application'),
  tags?: string(name='Tags', description='["d42921c4-5433-4abd-8075-0e536f8b\\\\*\\\\*\\\\*\\\\*"]', example='[{"key":"k1","value":"v1"}]'),
}

model TagResourcesResponseBody = {
  code?: string(name='Code', description='Indicates whether tags were added to the specified resources successfully. Valid values:

*   **true**: indicates that tags were added to the specified resources successfully.
*   **false**: indicates that tags could not be added to the specified resources.', example='200'),
  data?: boolean(name='Data', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='true'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. It can be used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='Indicates that the operation was successful.', example='0a98a02315955564772843261e****'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary cn-beijing
 *
 * @param request TagResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceIds)) {
    body['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tags)) {
    body['Tags'] = request.tags;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/tags`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary cn-beijing
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return tagResourcesWithOptions(request, headers, runtime);
}

model UnbindNlbRequest {
  appId?: string(name='AppId', description='A short description of struct', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  nlbId?: string(name='NlbId', description='The ID of NLB instance.', example='nlb-7z7jjbzz44d82c9***'),
  port?: int32(name='Port', description='The listener port of the instance. Valid values: 0 to 65535.', example='3306'),
  protocol?: string(name='Protocol', description='The type of the protocol. Valid values:

*   **TCP**.
*   **UDP**.
*   **TCPSSL**.', example='TCP'),
}

model UnbindNlbResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. The ID can be used to query the status of the change task.', example='ba386059-69b1-4e65-b1e5-0682d9fa****'),
  }(name='Data', description='The returned data.'),
  errorCode?: string(name='ErrorCode', description='The status code. Valid values:

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see **Error codes** section of this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   If the request was successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the internal-facing or Internet-facing NLB instance was disassociated. Valid values:

*   **true**: The NLB instance was disassociated.
*   **false**: The NLB instance failed to be disassociated.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a981dd515966966104121683d****'),
}

model UnbindNlbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindNlbResponseBody(name='body'),
}

/**
 * @summary Calls the UnbindNlb operation to delete an NLB listener bound for application access
 *
 * @param request UnbindNlbRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindNlbResponse
 */
async function unbindNlbWithOptions(request: UnbindNlbRequest, headers: map[string]string, runtime: $RuntimeOptions): UnbindNlbResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.nlbId)) {
    query['NlbId'] = request.nlbId;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.protocol)) {
    query['Protocol'] = request.protocol;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnbindNlb',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/nlb`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Calls the UnbindNlb operation to delete an NLB listener bound for application access
 *
 * @param request UnbindNlbRequest
 * @return UnbindNlbResponse
 */
async function unbindNlb(request: UnbindNlbRequest): UnbindNlbResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return unbindNlbWithOptions(request, headers, runtime);
}

model UnbindSlbRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  internet?: boolean(name='Internet', description='Specifies whether to disassociate the Internet-facing SLB instance. Valid values:

*   **true**: dissociates the Internet-facing SLB instance.
*   **false**: does not dissociate the Internet-facing SLB instance.', example='true'),
  intranet?: boolean(name='Intranet', description='Specifies whether to disassociate the internal-facing SLB instance. Valid values:

*   **true**: dissociates the internal-facing SLB instance.
*   **false**: does not dissociate the internal-facing SLB instance.', example='true'),
}

model UnbindSlbResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. The ID can be used to query the status of the change task.', example='4a815998-b468-4bea-b7d8-59f52a44****'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the internal-facing or Internet-facing SLB instance was disassociated. Valid values:

*   **true**: The SLB instance was disassociated.
*   **false**: The SLB instance failed to be disassociated.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model UnbindSlbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindSlbResponseBody(name='body'),
}

/**
 * @summary Disassociates an internal-facing or Internet-facing SLB instance from an application.
 *
 * @param request UnbindSlbRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindSlbResponse
 */
async function unbindSlbWithOptions(request: UnbindSlbRequest, headers: map[string]string, runtime: $RuntimeOptions): UnbindSlbResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.internet)) {
    query['Internet'] = request.internet;
  }
  if (!$isNull(request.intranet)) {
    query['Intranet'] = request.intranet;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UnbindSlb',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/slb`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates an internal-facing or Internet-facing SLB instance from an application.
 *
 * @param request UnbindSlbRequest
 * @return UnbindSlbResponse
 */
async function unbindSlb(request: UnbindSlbRequest): UnbindSlbResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return unbindSlbWithOptions(request, headers, runtime);
}

model UntagResourcesRequest {
  deleteAll?: boolean(name='DeleteAll', description='false', example='false'),
  regionId?: string(name='RegionId', description='cn-beijing

This parameter is required.', example='cn-beijing'),
  resourceIds?: string(name='ResourceIds', description='["d42921c4-5433-4abd-8075-0e536f8b\\\\*\\\\*\\\\*\\\\*"]

This parameter is required.', example='["d42921c4-5433-4abd-8075-0e536f8b****"]'),
  resourceType?: string(name='ResourceType', description='application

This parameter is required.', example='application'),
  tagKeys?: string(name='TagKeys', description='["k1","k2"]', example='["k1","k2"]'),
}

model UntagResourcesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.', example='200'),
  data?: boolean(name='Data', description='The returned data.', example='true'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the tags were removed. Valid values:

*   **true**: The tags were removed.
*   **false**: The tags could not be removed.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. It can be used to query details of a request.', example='0a98a02315955564772843261e****'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @param request UntagResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.deleteAll)) {
    query['DeleteAll'] = request.deleteAll;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceIds)) {
    query['ResourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKeys)) {
    query['TagKeys'] = request.tagKeys;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/tags`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return untagResourcesWithOptions(request, headers, runtime);
}

model UpdateAppSecurityGroupRequest {
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.

This parameter is required.', example='sg-wz969ngg2e49q5i4****'),
}

model UpdateAppSecurityGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the security group of the application was updated. Valid values:

*   **true**: The security group was updated.
*   **false**: The security group failed to be updated.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model UpdateAppSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppSecurityGroupResponseBody(name='body'),
}

/**
 * @summary Updates the security group of an application.
 *
 * @param request UpdateAppSecurityGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppSecurityGroupResponse
 */
async function updateAppSecurityGroupWithOptions(request: UpdateAppSecurityGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateAppSecurityGroupResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAppSecurityGroup',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/updateAppSecurityGroup`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the security group of an application.
 *
 * @param request UpdateAppSecurityGroupRequest
 * @return UpdateAppSecurityGroupResponse
 */
async function updateAppSecurityGroup(request: UpdateAppSecurityGroupRequest): UpdateAppSecurityGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateAppSecurityGroupWithOptions(request, headers, runtime);
}

model UpdateApplicationDescriptionRequest {
  appDescription?: string(name='AppDescription', description='This parameter is required.', example='newdesc'),
  appId?: string(name='AppId', description='This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
}

model UpdateApplicationDescriptionResponseBody = {
  code?: string(name='Code', example='200'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3***'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='ac1a0b2215622246421415014e****'),
}

model UpdateApplicationDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationDescriptionResponseBody(name='body'),
}

/**
 * @summary Updates the description of an application.
 *
 * @param request UpdateApplicationDescriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationDescriptionResponse
 */
async function updateApplicationDescriptionWithOptions(request: UpdateApplicationDescriptionRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateApplicationDescriptionResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appDescription)) {
    query['AppDescription'] = request.appDescription;
  }
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateApplicationDescription',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/updateAppDescription`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the description of an application.
 *
 * @param request UpdateApplicationDescriptionRequest
 * @return UpdateApplicationDescriptionResponse
 */
async function updateApplicationDescription(request: UpdateApplicationDescriptionRequest): UpdateApplicationDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateApplicationDescriptionWithOptions(request, headers, runtime);
}

model UpdateApplicationScalingRuleRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  enableIdle?: boolean(name='EnableIdle'),
  minReadyInstanceRatio?: int32(name='MinReadyInstanceRatio', description='The percentage of the minimum number of available instances. Take note of the following rules:

*   If you set the value to **-1**, the minimum number of available instances is not determined based on this parameter. This is the default value.
*   If you set the value to a number **from 0 to 100**, the minimum number of available instances is calculated by using the following formula: Current number of instances × (Value of MinReadyInstanceRatio × 100%). The value is the nearest integer rounded up from the calculated result. For example, if you set this parameter to **50**, and five instances are available, the minimum number of available instances is 3.

> When **MinReadyInstance** and **MinReadyInstanceRatio** are specified and **MinReadyInstanceRatio** is set to a number from 0 to 100, the value of \\\\*\\\\*MinReadyInstanceRatio** takes precedence.**** For example, if **MinReadyInstances** is set to **5\\\\*\\\\*, and **MinReadyInstanceRatio** is set to **50**, the minimum number of available instances is set to the nearest integer rounded up from the calculated result of the following formula: Current number of instances × **50%**.', example='-1'),
  minReadyInstances?: int32(name='MinReadyInstances', description='The minimum number of available instances. Take note of the following rules:

*   If you set the value to **0**, business interruptions occur when the auto-scaling policy is updated.
*   If you set the value to \\\\*\\\\*-1\\\\*\\\\*, the minimum number of available instances is automatically set to a system-recommended value. The value is the nearest integer to which the calculated result of the following formula is rounded up: Current number of instances × 25%. For example, if five instances are available, the minimum number of available instances is calculated by using the following formula: 5 × 25% = 1.25. In this case, the minimum number of available instances is 2.

> Make sure that at least one instance is available during application deployment and rollback to prevent business interruptions.', example='3'),
  scalingRuleMetric?: string(name='ScalingRuleMetric', description='The configurations of the metric-based auto scaling policy. This parameter is required if you set the ScalingRuleType parameter to metric.

Parameter description:

*   **maxReplicas**: the maximum number of instances in the application.

*   **minReplicas**: the minimum number of instances in the application.

*   **metricType**: the metric that is used to trigger the auto scaling policy.

    *   **CPU**: the CPU utilization.
    *   **MEMORY**: the memory usage.
    *   **tcpActiveConn**: the average number of active TCP connections in an application instance within 30 seconds.
    *   **SLB_QPS**: the average queries per second (QPS) of the Internet-facing Server Load Balancer (SLB) instance associated with an application instance within 15 seconds.
    *   **SLB_RT**: the average response time of the Internet-facing SLB instance within 15 seconds.

*   **metricTargetAverageUtilization**: the limit on the metric specified by the **metricType** parameter.

    *   The limit on the CPU utilization. Unit: percentage.
    *   The limit on the memory usage. Unit: percentage.
    *   The limit on the average number of active TCP connections per second.
    *   The limit on the QPS of the Internet-facing SLB instance.
    *   The limit on the response time of the Internet-facing SLB instance. Unit: milliseconds.

*   **SlbProject**: the Log Service project.

*   **SlbLogstore**: the Log Service Logstore.

*   **Vport**: the listener port for the SLB instance. HTTP and HTTPS are supported.

*   **scaleUpRules**: the scale-out rule.

*   **scaleDownRules**: the scale-in rule.

*   **step**: the scale-out or scale-in step size. The maximum number of instances that can be added or removed per unit time.

*   **disabled**: specifies whether to disable the application scale-in. If you set this parameter to true, the application instances are never scaled in. This prevents business risks during peak hours.

    *   **true**: disables the application scale-in.
    *   **false**: enables the application scale-in. Default value: false.

*   **stabilizationWindowSeconds**: the cooldown period during which the system is stable and does not perform scale-out or scale-in operations. Valid values: 0 to 3600. Unit: seconds. Default value: 0.

> You can specify one or more metrics as the trigger conditions of the auto scaling policy. If you specify multiple metrics, the application is scaled out when the value of a metric is greater than or equal to the limit. The number of application instances after the scale-out cannot exceed the configured maximum number of application instances. If the values of all the metrics are less than the limits, the application is scaled in. The number of instances after the scale-in cannot be less than the configured minimum number of application instances.', example='{"maxReplicas":3,"minReplicas":1,"metrics":[{"metricType":"CPU","metricTargetAverageUtilization":20},{"metricType":"MEMORY","metricTargetAverageUtilization":30},{"metricType":"tcpActiveConn","metricTargetAverageUtilization":20},{"metricType":"SLB_QPS","MetricTargetAverageUtilization":25,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","SlbLogstore":"function-log","Vport":"80"},{"metricType":"SLB_RT","MetricTargetAverageUtilization":35,"SlbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","SlbLogstore":"function-log","Vport":"80"}],"scaleUpRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":0},"scaleDownRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":300}}'),
  scalingRuleName?: string(name='ScalingRuleName', description='The name of the auto scaling policy. The name must start with a lowercase letter and can contain only lowercase letters, digits, and hyphens (-). The name cannot exceed 32 characters in length.

> You cannot change the names of created policies.

This parameter is required.', example='timer-0800-2100'),
  scalingRuleTimer?: string(name='ScalingRuleTimer', description='The configurations of the scheduled auto scaling policy. This parameter is required when you set the ScalingRuleType parameter to timing or when you want to create a scheduled auto scaling policy by using an SDK.

Parameter description:

*   **beginDate** and **endDate**: specify the validity period of the scheduled auto scaling policy. **beginDate** specifies the start date and **endDate** specifies the end date. Take note of the following rules:

    *   If you set the two parameters to **null**, the scheduled auto scaling policy is a long-term policy. Default values of the beginDate and endDate parameters: null.
    *   If you set the two parameters to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if you set **beginDate** to **2021-03-25** and **endDate** to **2021-04-25**, the auto scaling policy is valid for one month.

*   **period**: specifies the frequency at which the scheduled auto scaling policy is executed. Valid values:

    *   **\\\\* \\\\* \\\\***: The scheduled auto scaling policy is executed at a specified point in time every day.

    *   **\\\\* \\\\* Fri,Mon**: The scheduled auto scaling policy is executed at a specified point in time on one or more specified days of each week. GMT+8 is used. Valid values:

        *   **Sun**
        *   **Mon**
        *   **Tue**
        *   **Wed**
        *   **Thu**
        *   **Fri**
        *   **Sat**

    *   **1,2,3,28,31 \\\\* \\\\***: The scheduled auto scaling policy is executed at a specified point in time on one or more days of each month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy is executed on the specified days other than the 31st day.

*   **schedules**: specifies the points in time at which the auto scaling policy is triggered and the number of application instances that are retained during the corresponding period of time. You can specify up to 20 points in time. Parameter description:

    *   **atTime**: the point in time at which the policy is triggered. Format: **Hour:Minute**. Example: **08:00**.

    *   **targetReplicas**: specifies the number of application instances that you want to maintain by using this policy. You can also set the value to the minimum number of available instances required for each application release. Valid values: 1 to 50.

        **

        **Note**Make sure that at least **one** instance is available during the application deployment and rollback to prevent your business from being interrupted. If you set the value to **0**, business interruptions occur when the application is updated.', example='{"beginDate":null,"endDate":null,"period":"* * *","schedules":[{"atTime":"08:00","targetReplicas":10},{"atTime":"20:00","targetReplicas":3}]}'),
}

model UpdateApplicationScalingRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    createTime?: long(name='CreateTime', description='The time when the auto scaling policy was created. Unit: milliseconds.', example='1616642248938'),
    enableIdle?: boolean(name='EnableIdle'),
    lastDisableTime?: long(name='LastDisableTime', description='The time when the auto scaling policy was last disabled.', example='1641882854484'),
    metric?: {
      maxReplicas?: int32(name='MaxReplicas', description='The maximum number of instances.', example='3'),
      metrics?: [ 
        {
          metricTargetAverageUtilization?: int32(name='MetricTargetAverageUtilization', description='The limit on the metric.

*   The limit on the CPU utilization. Unit: percentage.
*   The limit on the memory usage. Unit: percentage.
*   The limit on the average number of active TCP connections per second.
*   The limit on the QPS of the Internet-facing SLB instance.
*   The limit on the response time of the Internet-facing SLB instance. Unit: milliseconds.', example='20'),
          metricType?: string(name='MetricType', description='The metric that is used to trigger the auto scaling policy. Valid values:

*   **CPU**: the CPU utilization.
*   **MEMORY**: the memory usage.
*   **tcpActiveConn**: the average number of active TCP connections of an application instance within 30 seconds.
*   **SLB_QPS**: the average QPS of the Internet-facing SLB instance associated with an application instance within 15 seconds.
*   **SLB_RT**: the average response time of the Internet-facing SLB instance within 15 seconds.', example='CPU'),
          slbId?: string(name='SlbId', example='lb-xxx'),
          slbLogstore?: string(name='SlbLogstore', example='test'),
          slbProject?: string(name='SlbProject', example='test'),
          vport?: string(name='Vport', example='80'),
        }
      ](name='Metrics', description='The metrics that are used to trigger the auto scaling policy.'),
      minReplicas?: int32(name='MinReplicas', description='The minimum number of instances.', example='1'),
    }(name='Metric', description='The details of the metric-based auto scaling policy.'),
    scaleRuleEnabled?: boolean(name='ScaleRuleEnabled', description='Specifies whether to enable the auto scaling policy. Valid values:

*   **true**: The auto scaling policy is enabled.
*   **false**: The auto scaling policy is disabled.', example='true'),
    scaleRuleName?: string(name='ScaleRuleName', description='The name of the auto scaling policy.', example='test'),
    scaleRuleType?: string(name='ScaleRuleType', description='The type of the auto scaling policy. Valid values:

*   **timing**: a scheduled auto scaling policy
*   **metric**: a metric-based auto scaling policy
*   **mix**: a hybrid auto scaling policy', example='timing'),
    timer?: {
      beginDate?: string(name='BeginDate', description='The start date of the validity period of the scheduled auto scaling policy. Parameter description:

*   If **BeginDate** and **EndDate** are set to **null**, the auto scaling policy is a long-term policy. Default values of the beginDate and endDate parameters: null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is set to 2021-03-25 and **EndDate** is set to 2021-04-25, the auto scaling policy is valid for one month.', example='2021-03-25'),
      endDate?: string(name='EndDate', description='The end date of the validity period of the scheduled auto scaling policy. Take note of the following rules:

*   If **BeginDate** and **EndDate** are set to **null**, the auto scaling policy is a long-term policy. Default values of the beginDate and endDate parameters: null.
*   If the two parameters are set to specific dates, the scheduled auto scaling policy can be triggered during the period between the two dates. For example, if **BeginDate** is set to 2021-03-25 and **EndDate** is set to 2021-04-25, the auto scaling policy is valid for one month.', example='2021-04-25'),
      period?: string(name='Period', description='The frequency at which the scheduled auto scaling policy is executed. Valid values:

*   **\\\\* \\\\* \\\\***: The scheduled auto scaling policy is executed at a specified point in time every day.

*   **\\\\* \\\\* Fri,Mon**: The scheduled auto scaling policy is executed at a specified point in time on one or more days of each week. GMT+8 is used. Valid values:

    *   **Sun**
    *   **Mon**
    *   **Tue**
    *   **Wed**
    *   **Thu**
    *   **Fri**
    *   **Sat**

*   **1,2,3,28,31 \\\\* \\\\***: The scheduled auto scaling policy is executed at a specified point in time on one or more days of each month. Valid values: 1 to 31. If the month does not have a 31st day, the auto scaling policy is executed on the specified days other than the 31st day.', example='* * *'),
      schedules?: [ 
        {
          atTime?: string(name='AtTime', description='The point in time. Format: **Hour:Minute**.', example='08:00'),
          maxReplicas?: int32(name='MaxReplicas', example='10'),
          minReplicas?: int32(name='MinReplicas', example='1'),
          targetReplicas?: int32(name='TargetReplicas', description='The expected number of instances.', example='3'),
        }
      ](name='Schedules', description='The points in time at which the auto scaling policy is triggered within one day.'),
    }(name='Timer', description='The details of the scheduled auto scaling policy.'),
    updateTime?: long(name='UpdateTime', description='The time when the auto scaling policy was updated. Unit: milliseconds.', example='1616642248938'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   If the call is successful, **ErrorCode** is not returned.
*   If the call fails, **ErrorCode** is returned. For more information, see the "**Error codes**" section in this topic.', example='Null'),
  message?: string(name='Message', description='The returned message. Take note of the following rules:

*   If the call is successful, **success** is returned.
*   If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Specifies whether the instances are successfully restarted. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model UpdateApplicationScalingRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationScalingRuleResponseBody(name='body'),
}

/**
 * @summary Updates the auto scaling policy of an application.
 *
 * @description ##
 * If you want to configure more than 50 instances for an application, you must submit a [ticket](https://workorder.console.aliyun.com/#/ticket/createIndex) to add your account to the whitelist.
 *
 * @param request UpdateApplicationScalingRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationScalingRuleResponse
 */
async function updateApplicationScalingRuleWithOptions(request: UpdateApplicationScalingRuleRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateApplicationScalingRuleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.enableIdle)) {
    query['EnableIdle'] = request.enableIdle;
  }
  if (!$isNull(request.minReadyInstanceRatio)) {
    query['MinReadyInstanceRatio'] = request.minReadyInstanceRatio;
  }
  if (!$isNull(request.minReadyInstances)) {
    query['MinReadyInstances'] = request.minReadyInstances;
  }
  if (!$isNull(request.scalingRuleMetric)) {
    query['ScalingRuleMetric'] = request.scalingRuleMetric;
  }
  if (!$isNull(request.scalingRuleName)) {
    query['ScalingRuleName'] = request.scalingRuleName;
  }
  if (!$isNull(request.scalingRuleTimer)) {
    query['ScalingRuleTimer'] = request.scalingRuleTimer;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateApplicationScalingRule',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/scale/applicationScalingRule`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the auto scaling policy of an application.
 *
 * @description ##
 * If you want to configure more than 50 instances for an application, you must submit a [ticket](https://workorder.console.aliyun.com/#/ticket/createIndex) to add your account to the whitelist.
 *
 * @param request UpdateApplicationScalingRuleRequest
 * @return UpdateApplicationScalingRuleResponse
 */
async function updateApplicationScalingRule(request: UpdateApplicationScalingRuleRequest): UpdateApplicationScalingRuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateApplicationScalingRuleWithOptions(request, headers, runtime);
}

model UpdateApplicationVswitchesRequest {
  appId?: string(name='AppId', description='The application ID.

This parameter is required.', example='0099b7be-5f5b-4512-a7fc-56049ef1****'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch.

This parameter is required.', example='vsw-2ze559r1z1bpwqxwp****'),
}

model UpdateApplicationVswitchesResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the request was successful, this parameter is not returned.****
*   If the request failed, **ErrorCode** is returned. For more information, see **Error code** section of this topic.'),
  message?: string(name='Message', description='The message returned. Valid values:

*   If the request was successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the list of applications was obtained. Valid values:

*   **true**: The applications were obtained.
*   **false**: The applications failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The ID of the trace. The ID is used to query the details of a request.', example='0a98a02315955564772843261e****'),
}

model UpdateApplicationVswitchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicationVswitchesResponseBody(name='body'),
}

/**
 * @summary Update the configuration of a vSwitch.
 *
 * @param request UpdateApplicationVswitchesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateApplicationVswitchesResponse
 */
async function updateApplicationVswitchesWithOptions(request: UpdateApplicationVswitchesRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateApplicationVswitchesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateApplicationVswitches',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/updateAppVswitches`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the configuration of a vSwitch.
 *
 * @param request UpdateApplicationVswitchesRequest
 * @return UpdateApplicationVswitchesResponse
 */
async function updateApplicationVswitches(request: UpdateApplicationVswitchesRequest): UpdateApplicationVswitchesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateApplicationVswitchesWithOptions(request, headers, runtime);
}

model UpdateConfigMapRequest {
  configMapId?: long(name='ConfigMapId', description='The ID of the request.

This parameter is required.', example='1'),
  data?: string(name='Data', description='This parameter is required.', example='{"env.shell": "/bin/sh"}'),
  description?: string(name='Description', example='test-desc'),
}

model UpdateConfigMapResponseBody = {
  code?: string(name='Code', description='Indicates whether the ConfigMap instance was updated. Valid values:

*   **true**: The instance was updated.
*   **false**: The instance failed to be updated.', example='200'),
  data?: {
    configMapId?: string(name='ConfigMapId', description='The returned error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='1'),
  }(name='Data', description='The ID of the ConfigMap instance.'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx:**: indicates that the call was successful.
*   **3xx**: indicates that the call was redirected.
*   **4xx**: indicates that the call failed.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. The ID is used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned information.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The returned result.', example='0a98a02315955564772843261e****'),
}

model UpdateConfigMapResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConfigMapResponseBody(name='body'),
}

/**
 * @summary Update a ConfigMap.
 *
 * @param request UpdateConfigMapRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConfigMapResponse
 */
async function updateConfigMapWithOptions(request: UpdateConfigMapRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateConfigMapResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.configMapId)) {
    query['ConfigMapId'] = request.configMapId;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }

  var body : map[string]any = {};
  if (!$isNull(request.data)) {
    body['Data'] = request.data;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateConfigMap',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/configmap/configMap`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update a ConfigMap.
 *
 * @param request UpdateConfigMapRequest
 * @return UpdateConfigMapResponse
 */
async function updateConfigMap(request: UpdateConfigMapRequest): UpdateConfigMapResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateConfigMapWithOptions(request, headers, runtime);
}

model UpdateGreyTagRouteRequest {
  albRules?: string(name='AlbRules', description='The canary release rule of the application for which ALB gateway routing is configured.', example='[{"condition":"AND","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"sourceIp","value":"127.0.0.1"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}]'),
  description?: string(name='Description', description='The description of the canary release rule.', example='灰度发布-地域灰度'),
  dubboRules?: string(name='DubboRules', description='The canary release rule of the Dubbo application.', example='[{"condition":"OR","group":"DUBBO","items":[{"cond":"==","expr":".key1","index":0,"operator":"rawvalue","value":"value1"},{"cond":"==","expr":".key2","index":0,"operator":"rawvalue","value":"value2"}],"methodName":"echo","serviceName":"com.alibaba.edas.boot.EchoService","version":"1.0.0"}]'),
  greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule.

This parameter is required.', example='1'),
  scRules?: string(name='ScRules', description='The canary release rule of the Spring Cloud application.', example='[{"condition":"OR","items":[{"cond":"==","name":"grey","operator":"rawvalue","type":"param","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"cookie","value":"true"},{"cond":"==","name":"grey","operator":"rawvalue","type":"header","value":"true"}],"path":"/post-echo/hi"}]'),
}

model UpdateGreyTagRouteResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    greyTagRouteId?: long(name='GreyTagRouteId', description='The ID of the canary release rule. The ID is globally unique.', example='1'),
  }(name='Data', description='The information about the canary release rule.'),
  errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the call is successful, the **ErrorCode** parameter is not returned.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the **Error codes** section in this topic.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='9D29CBD0-45D3-410B-9826-52F86F90****'),
  success?: boolean(name='Success', description='Indicates whether the information of the change order was queried. Valid values:

*   **true**: The information was queried.
*   **false**: The information failed to be queried.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model UpdateGreyTagRouteResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGreyTagRouteResponseBody(name='body'),
}

/**
 * @summary Updates a canary release rule.
 *
 * @param request UpdateGreyTagRouteRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateGreyTagRouteResponse
 */
async function updateGreyTagRouteWithOptions(request: UpdateGreyTagRouteRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateGreyTagRouteResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.albRules)) {
    query['AlbRules'] = request.albRules;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.dubboRules)) {
    query['DubboRules'] = request.dubboRules;
  }
  if (!$isNull(request.greyTagRouteId)) {
    query['GreyTagRouteId'] = request.greyTagRouteId;
  }
  if (!$isNull(request.scRules)) {
    query['ScRules'] = request.scRules;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateGreyTagRoute',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/tagroute/greyTagRoute`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a canary release rule.
 *
 * @param request UpdateGreyTagRouteRequest
 * @return UpdateGreyTagRouteResponse
 */
async function updateGreyTagRoute(request: UpdateGreyTagRouteRequest): UpdateGreyTagRouteResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateGreyTagRouteWithOptions(request, headers, runtime);
}

model UpdateIngressRequest {
  certId?: string(name='CertId', description='The ID of the certificate that is associated with the Classic Load Balancer (**CLB**) instance.

*   If you set **LoadBalanceType** to **clb**, you can use CertId to configure a certificate for the HTTPS listener.

For more information about how to manage the SSL certificate IDs that are used by CLB instances, see [Overview](https://help.aliyun.com/document_detail/90792.html).', example='188077086902****_176993d****_181437****_108724****'),
  certIds?: string(name='CertIds', description='The IDs of the certificates that are associated with the Application Load Balancer (**ALB**) instance.

*   If you set **LoadBalanceType** to **alb**, you can use CertIds to configure multiple certificates for the HTTPS listener. Separate multiple certificate IDs with commas (,).
*   The ID of the SSL certificate that is used by an ALB instance can be obtained from Certificate Management Service. For example, if you specify `756***-cn-hangzhou`, `756***` is the certificate ID that is obtained from the service page, and `-cn-hangzhou` is the fixed suffix. For more information, see [Manage certificates](https://help.aliyun.com/document_detail/209076.html).', example='87***35-cn-hangzhou,812***3-cn-hangzhou'),
  corsConfig?: string(name='CorsConfig'),
  defaultRule?: string(name='DefaultRule', description='The default forwarding rule. You can specify a port and an application in the default forwarding rule to forward traffic based on the IP address. The following list describes the involved parameters:

*   **appId**: the ID of the application.
*   **containerPort**: the container port of the application.

>  All requests that do not match the forwarding rules specified for Rules are forwarded over the port to the application.', example='{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080}'),
  description?: string(name='Description', description='The name of the routing rule.', example='ingress-sae-test'),
  enableXForwardedFor?: boolean(name='EnableXForwardedFor'),
  enableXForwardedForClientSrcPort?: boolean(name='EnableXForwardedForClientSrcPort'),
  enableXForwardedForProto?: boolean(name='EnableXForwardedForProto'),
  enableXForwardedForSlbId?: boolean(name='EnableXForwardedForSlbId'),
  enableXForwardedForSlbPort?: boolean(name='EnableXForwardedForSlbPort'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of idle connections. Unit: seconds.

>  A value of 0 indicates that the default value is used.', example='15'),
  ingressId?: long(name='IngressId', description='The ID of the routing rule.

This parameter is required.', example='87'),
  listenerPort?: string(name='ListenerPort', description='The port specified for the Server Load Balancer (SLB) listener. You must specify a vacant port.', example='443'),
  listenerProtocol?: string(name='ListenerProtocol', description='The protocol that is used to forward requests. Valid values:

*   **HTTP**: HTTP is suitable for applications that need to identify the transmitted data.
*   **HTTPS**: HTTPS is suitable for applications that require encrypted data transmission.', example='HTTP'),
  loadBalanceType?: string(name='LoadBalanceType', description='This parameter is discontinued.', example='clb'),
  requestTimeout?: int32(name='RequestTimeout', description='The request timed out. Unit: seconds.', example='60'),
  rules?: string(name='Rules', description='The forwarding rules. You can specify a port and an application in a forwarding rule to forward traffic based on the specified domain name and request path. The following list describes the involved parameters:

*   **appId**: the ID of the application.
*   **containerPort**: the container port of the application.
*   **domain**: the domain name.
*   **path**: the request path.', example='[{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080,"domain":"www.sae.site","path":"/path1"},{"appId":"666403ce-d25b-47cf-87fe-497565d2****","containerPort":8080,"domain":"sae.site","path":"/path2"}]'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of a security policy.', example='tls_cipher_policy_1_2_strict_with_1_3'),
}

model UpdateIngressResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The request was successful.
*   **3xx**: The request was redirected.
*   **4xx**: The request failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    ingressId?: long(name='IngressId', description='The ID of the routing rule.', example='87'),
  }(name='Data', description='The returned result.'),
  errorCode?: string(name='ErrorCode', description='The error code.

*   If the request was successful, **ErrorCode** is not returned.
*   If the request failed, **ErrorCode** is returned. For more information, see the **Error codes** section of this topic.'),
  message?: string(name='Message', description='The returned information.

*   If the request was successful, **success** is returned.
*   If the request failed, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the configurations of the routing rule were updated. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID.', example='0a98a02315955564772843261e****'),
}

model UpdateIngressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIngressResponseBody(name='body'),
}

/**
 * @summary Update the configurations of an Ingress instance.
 *
 * @param request UpdateIngressRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIngressResponse
 */
async function updateIngressWithOptions(request: UpdateIngressRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateIngressResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.certId)) {
    query['CertId'] = request.certId;
  }
  if (!$isNull(request.certIds)) {
    query['CertIds'] = request.certIds;
  }
  if (!$isNull(request.corsConfig)) {
    query['CorsConfig'] = request.corsConfig;
  }
  if (!$isNull(request.defaultRule)) {
    query['DefaultRule'] = request.defaultRule;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.enableXForwardedFor)) {
    query['EnableXForwardedFor'] = request.enableXForwardedFor;
  }
  if (!$isNull(request.enableXForwardedForClientSrcPort)) {
    query['EnableXForwardedForClientSrcPort'] = request.enableXForwardedForClientSrcPort;
  }
  if (!$isNull(request.enableXForwardedForProto)) {
    query['EnableXForwardedForProto'] = request.enableXForwardedForProto;
  }
  if (!$isNull(request.enableXForwardedForSlbId)) {
    query['EnableXForwardedForSlbId'] = request.enableXForwardedForSlbId;
  }
  if (!$isNull(request.enableXForwardedForSlbPort)) {
    query['EnableXForwardedForSlbPort'] = request.enableXForwardedForSlbPort;
  }
  if (!$isNull(request.idleTimeout)) {
    query['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.ingressId)) {
    query['IngressId'] = request.ingressId;
  }
  if (!$isNull(request.listenerPort)) {
    query['ListenerPort'] = request.listenerPort;
  }
  if (!$isNull(request.listenerProtocol)) {
    query['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalanceType)) {
    query['LoadBalanceType'] = request.loadBalanceType;
  }
  if (!$isNull(request.requestTimeout)) {
    query['RequestTimeout'] = request.requestTimeout;
  }
  if (!$isNull(request.securityPolicyId)) {
    query['SecurityPolicyId'] = request.securityPolicyId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.rules)) {
    body['Rules'] = request.rules;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateIngress',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/ingress/Ingress`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the configurations of an Ingress instance.
 *
 * @param request UpdateIngressRequest
 * @return UpdateIngressResponse
 */
async function updateIngress(request: UpdateIngressRequest): UpdateIngressResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateIngressWithOptions(request, headers, runtime);
}

model UpdateJobRequest {
  acrAssumeRoleArn?: string(name='AcrAssumeRoleArn', description='The Alibaba Cloud Resource Name (ARN) of the RAM role that is used to pull images across accounts. For more information, see [Grant permissions across Alibaba Cloud accounts by using a RAM role](https://help.aliyun.com/document_detail/223585.html).', example='acs:ram::123456789012****:role/adminrole'),
  acrInstanceId?: string(name='AcrInstanceId', description='The ID of Container Registry Enterprise Edition instance N. This parameter is required when the **ImageUrl** parameter is set to the URL of an image in an ACR Enterprise Edition instance.', example='cri-xxxxxx'),
  appId?: string(name='AppId', description='The ID of the application.

This parameter is required.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  backoffLimit?: long(name='BackoffLimit', description='The number of times the job is retried.', example='3'),
  command?: string(name='Command', description='The command that is used to start the image. The command must be an existing executable object in the container. Example:

    command:
          - echo
          - abc
          - >
          - file0

In this example, the Command parameter is set to `Command="echo", CommandArgs=["abc", ">", "file0"]`.', example='echo'),
  commandArgs?: string(name='CommandArgs', description='The parameters of the image startup command. The CommandArgs parameter specifies the parameters that are required for the **Command** parameter. The name must meet the following format requirements:

`["a","b"]`

In the preceding example, the CommandArgs parameter is set to `CommandArgs=["abc", ">", "file0"]`. The data type of `["abc", ">", "file0"]` must be an array of strings in the JSON format. This parameter is optional.', example='["a","b"]'),
  concurrencyPolicy?: string(name='ConcurrencyPolicy', description='The concurrency policy of the job. Valid values:

*   **Forbid**: Prohibits concurrent running. If the previous job is not completed, no new job is created.
*   **Allow**: Allows concurrent running.
*   **Replace**: If the previous job is not completed when the time to create a new job is reached, the new job replaces the previous job.', example='Allow'),
  configMapMountDesc?: string(name='ConfigMapMountDesc', description='The description of the **ConfigMap** instance mounted to the application. Use configurations created on the Configuration Items page to configure containers. The following parameters are involved:

*   **congfigMapId**: the ID of the ConfigMap instance. You can call the [ListNamespacedConfigMaps](https://help.aliyun.com/document_detail/176917.html) operation to obtain the ID.
*   **key**: the key.

> You can use the `sae-sys-configmap-all` key to mount all keys.

*   **mountPath**: the mount path.', example='[{"configMapId":16,"key":"test","mountPath":"/tmp"}]'),
  customHostAlias?: string(name='CustomHostAlias', description='The custom mappings between hostnames and IP addresses in the container. Valid values:

*   **hostName**: the domain name or hostname.
*   **ip**: the IP address.', example='[{"hostName":"samplehost","ip":"127.0.0.1"}]'),
  edasContainerVersion?: string(name='EdasContainerVersion', description='The version of the container, such as Ali-Tomcat, in which an application developed based on High-speed Service Framework (HSF) is deployed.', example='3.5.3'),
  enableImageAccl?: boolean(name='EnableImageAccl'),
  envs?: string(name='Envs', description='The environment variables. You can configure custom environment variables or reference a ConfigMap. If you want to reference a ConfigMap, you must first create a ConfigMap. For more information, see [CreateConfigMap](https://help.aliyun.com/document_detail/176914.html). Valid values:

*   Configure custom environment variables

    *   **name**: the name of the environment variable.
    *   **value**: the value of the environment variable.

*   Reference ConfigMap

    *   **name**: the name of the environment variable. You can reference one or all keys. If you want to reference all keys, specify `sae-sys-configmap-all-<ConfigMap name>`. Example: `sae-sys-configmap-all-test1`.
    *   **valueFrom**: the reference of the environment variable. Set the value to `configMapRef`.
    *   **configMapId**: the ConfigMap ID.
    *   **key**: the key. If you want to reference all keys, do not configure this parameter.', example='[{"name":"envtmp","value":"0"}]'),
  imagePullSecrets?: string(name='ImagePullSecrets', description='The ID of the corresponding Secret.', example='10'),
  imageUrl?: string(name='ImageUrl', description='The URL of the image. This parameter is returned only if the **PackageType** parameter is set to **Image**.', example='registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1'),
  jarStartArgs?: string(name='JarStartArgs', description='The arguments in the JAR package. The arguments are used to start the application container. The default startup command is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='-Xms4G -Xmx4G'),
  jarStartOptions?: string(name='JarStartOptions', description='The option settings in the JAR package. The settings are used to start the application container. The default startup command for application deployment is `$JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs`.', example='custom-option'),
  jdk?: string(name='Jdk', description='The version of the Java development kit (JDK) on which the deployment package of the application depends. The following versions are supported:

*   **Open JDK 8**
*   **Open JDK 7**
*   **Dragonwell 11**
*   **Dragonwell 8**
*   **openjdk-8u191-jdk-alpine3.9**
*   **openjdk-7u201-jdk-alpine3.9**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='Open JDK 8'),
  mountDesc?: string(name='MountDesc', description='The configurations for mounting the NAS file system. If you do not need to modify the NAS configurations when you deploy the application, configure **MountDesc** only in the first request. If you no longer need to use NAS, leave **MountDesc** empty in the request.', example='[{mountPath: "/tmp", nasPath: "/"}]'),
  mountHost?: string(name='MountHost', description='The mount target of the NAS file system in the VPC where the application is deployed. If you do not need to modify this configuration during the deployment, configure the **MountHost** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you need to remove this configuration, leave the **MountHost** parameter empty in the request.', example='10d3b4bc9****.com'),
  nasId?: string(name='NasId', description='The ID of the Apsara File Storage NAS file system. If you do not need to modify the NAS configurations when you deploy the application, configure **NasId** only in the first request. If you no longer need to use NAS, leave **NasId** empty in the request.', example='10d3b4****'),
  ossAkId?: string(name='OssAkId', description='The AccessKey ID that is used to read data from and write data to OSS.', example='xxxxxx'),
  ossAkSecret?: string(name='OssAkSecret', description='The AccessKey secret that is used to read data from and write data to OSS.', example='xxxxxx'),
  ossMountDescs?: string(name='OssMountDescs', description='The information about the mounted Object Storage Service (OSS) bucket. The following parameters are involved:

*   **bucketName**: the name of the OSS bucket.

*   **bucketPath**: the directory or object in OSS. If the specified directory or object does not exist, an error is returned.

*   **mountPath**: the directory of the container in SAE. If the path already exists, the newly specified path overwrites the previous one. If the path does not exist, it is created.

*   **readOnly**: specifies whether to only allow the container path to read data from the OSS directory. Valid values:

    *   **true**: The container path only has read permission on the OSS directory.
    *   **false**: The application has read and write permissions.', example='[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}]'),
  packageUrl?: string(name='PackageUrl', description='The address of the deployment package. This parameter is required if you set **PackageType** to **FatJar**, **War**, or **PythonZip**.', example='http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar'),
  packageVersion?: string(name='PackageVersion', description='The version of the deployment package. This parameter is required if you set **PackageType** to **FatJar**, **War**, or **PythonZip**.', example='1.0.1'),
  php?: string(name='Php', description='The ID of Container Registry Enterprise Edition instance N.', example='cri-xxxxxx'),
  phpConfig?: string(name='PhpConfig', description='The details of the PHP configuration file.', example='k1=v1'),
  phpConfigLocation?: string(name='PhpConfigLocation', description='The path on which the PHP configuration file for application startup is mounted. Make sure that the PHP server uses this configuration file during the startup.', example='/usr/local/etc/php/php.ini'),
  postStart?: string(name='PostStart', description='The script to be run after the container is started. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  preStop?: string(name='PreStop', description='The script that is run before the container is stopped. Example: `{"exec":{"command":["sh","-c","echo hello"\\\\]}}`', example='{"exec":{"command":["sh","-c","echo hello"]}}'),
  programmingLanguage?: string(name='ProgrammingLanguage', description='The programming language. Valid values: **java**, **php**, **python**, and **shell**.', example='java'),
  python?: string(name='Python', description='The Python environment. Set the value to **PYTHON 3.9.15**.', example='PYTHON 3.9.15'),
  pythonModules?: string(name='PythonModules', description='The configurations for installing custom module dependencies. By default, the dependencies defined by the requirements.txt file in the root directory are installed. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box.', example='Flask==2.0'),
  refAppId?: string(name='RefAppId', description='The ID of the job that you reference.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
  replicas?: string(name='Replicas', description='The number of concurrent instances.', example='3'),
  slice?: boolean(name='Slice', description='Specifies whether to enable job sharding.', example='true'),
  sliceEnvs?: string(name='SliceEnvs', description='The parameters of job sharding.', example='[0,1,2]'),
  slsConfigs?: string(name='SlsConfigs', description='The configurations of Log Service.

*   To use Log Service resources that are automatically created by SAE, set this parameter to `[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]`.
*   To use custom Log Service resources, set this parameter to `[{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}]`.

The following parameters are involved:

*   **projectName**: the name of the Log Service project.
*   **logDir**: the path in which logs are stored.
*   **logType**: the log type. **stdout**: the standard output log of the container. You can specify only one stdout value for this parameter. If you leave this parameter empty, file logs are collected.
*   **logstoreName**: the name of the Logstore in Log Service.
*   **logtailName**: the name of the Logtail configuration in Log Service. If you do not configure this parameter, a new Logtail configuration is created.

If you do not need to modify the logging configurations when you deploy the application, configure the **SlsConfigs** parameter only in the first request. You do not need to include this parameter in subsequent requests. If you no longer need to use Log Service, leave the **SlsConfigs** parameter empty in the request.

> A Log Service project that is automatically created by SAE when you create an application is deleted when the application is deleted. Therefore, when you create an application, you cannot select a Log Service project that is automatically created by SAE for log collection.', example='[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]'),
  terminationGracePeriodSeconds?: int32(name='TerminationGracePeriodSeconds', description='The timeout period for a graceful shutdown. Default value: 30. Unit: seconds. Valid values: 1 to 300.', example='10'),
  timeout?: long(name='Timeout', description='The timeout period. Unit: seconds.', example='3600'),
  timezone?: string(name='Timezone', description='The time zone. Default value: **Asia/Shanghai**.', example='Asia/Shanghai'),
  tomcatConfig?: string(name='TomcatConfig', description='The Tomcat configuration. If you want to delete the configuration, set this parameter to {} or leave this parameter empty. Valid values:

*   **port**: the port number. The port number ranges from 1024 to 65535. Though the admin permissions are configured for the container, the root permissions are required to perform operations on ports whose number is smaller than 1024. Enter a value that ranges from 1025 to 65535 because the container has only the admin permissions. If you do not specify this parameter, the default port number 8080 is used.
*   **contextPath**: the path. Default value: /. This value indicates the root directory.
*   **maxThreads**: the maximum number of connections in the connection pool. Default value: 400.
*   **uriEncoding**: the URI encoding scheme in the Tomcat container. Valid values: **UTF-8**, **ISO-8859-1**, **GBK**, and GB2312. If you do not specify this parameter, the default value **ISO-8859-1** is used.
*   **useBodyEncoding**: specifies whether to use the encoding scheme that is specified by **BodyEncoding for URL**. Default value: **true**.', example='{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}'),
  triggerConfig?: string(name='TriggerConfig'),
  warStartOptions?: string(name='WarStartOptions', description='The startup command of the WAR package. For information about how to configure the startup command, see [Configure startup commands](https://help.aliyun.com/document_detail/96677.html).', example='CATALINA_OPTS=\\\\"$CATALINA_OPTS $Options\\\\" catalina.sh run'),
  webContainer?: string(name='WebContainer', description='The version of the Tomcat container on which the deployment package depends. The following versions are supported:

*   **apache-tomcat-7.0.91**
*   **apache-tomcat-8.5.42**

This parameter is not returned if the **PackageType** parameter is set to **Image**.', example='apache-tomcat-7.0.91'),
}

model UpdateJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    appId?: string(name='AppId', description='The application ID.', example='7171a6ca-d1cd-4928-8642-7d5cfe69****'),
    changeOrderId?: string(name='ChangeOrderId', description='The ID of the change order. It can be used to query the task status.', example='01db03d3-3ee9-48b3-b3d0-dfce2d88****'),
  }(name='Data', description='The response.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Valid values:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The additional information that is returned. Valid values:

*   success: If the call is successful, **success** is returned.
*   An error code: If the call fails, an error code is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01CF26C7-00A3-4AA6-BA76-7E95F2A3***'),
  success?: boolean(name='Success', description='Indicates whether the application deployment is successful. Valid values:

*   **true**
*   **false**', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='ac1a0b2215622246421415014e****'),
}

model UpdateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateJobResponseBody(name='body'),
}

/**
 * @summary Updates a job template.
 *
 * @param request UpdateJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateJobResponse
 */
async function updateJobWithOptions(request: UpdateJobRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.acrAssumeRoleArn)) {
    query['AcrAssumeRoleArn'] = request.acrAssumeRoleArn;
  }
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!$isNull(request.backoffLimit)) {
    query['BackoffLimit'] = request.backoffLimit;
  }
  if (!$isNull(request.command)) {
    query['Command'] = request.command;
  }
  if (!$isNull(request.commandArgs)) {
    query['CommandArgs'] = request.commandArgs;
  }
  if (!$isNull(request.concurrencyPolicy)) {
    query['ConcurrencyPolicy'] = request.concurrencyPolicy;
  }
  if (!$isNull(request.customHostAlias)) {
    query['CustomHostAlias'] = request.customHostAlias;
  }
  if (!$isNull(request.edasContainerVersion)) {
    query['EdasContainerVersion'] = request.edasContainerVersion;
  }
  if (!$isNull(request.envs)) {
    query['Envs'] = request.envs;
  }
  if (!$isNull(request.imagePullSecrets)) {
    query['ImagePullSecrets'] = request.imagePullSecrets;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.jarStartArgs)) {
    query['JarStartArgs'] = request.jarStartArgs;
  }
  if (!$isNull(request.jarStartOptions)) {
    query['JarStartOptions'] = request.jarStartOptions;
  }
  if (!$isNull(request.jdk)) {
    query['Jdk'] = request.jdk;
  }
  if (!$isNull(request.mountDesc)) {
    query['MountDesc'] = request.mountDesc;
  }
  if (!$isNull(request.mountHost)) {
    query['MountHost'] = request.mountHost;
  }
  if (!$isNull(request.nasId)) {
    query['NasId'] = request.nasId;
  }
  if (!$isNull(request.packageUrl)) {
    query['PackageUrl'] = request.packageUrl;
  }
  if (!$isNull(request.packageVersion)) {
    query['PackageVersion'] = request.packageVersion;
  }
  if (!$isNull(request.phpConfigLocation)) {
    query['PhpConfigLocation'] = request.phpConfigLocation;
  }
  if (!$isNull(request.postStart)) {
    query['PostStart'] = request.postStart;
  }
  if (!$isNull(request.preStop)) {
    query['PreStop'] = request.preStop;
  }
  if (!$isNull(request.programmingLanguage)) {
    query['ProgrammingLanguage'] = request.programmingLanguage;
  }
  if (!$isNull(request.python)) {
    query['Python'] = request.python;
  }
  if (!$isNull(request.pythonModules)) {
    query['PythonModules'] = request.pythonModules;
  }
  if (!$isNull(request.refAppId)) {
    query['RefAppId'] = request.refAppId;
  }
  if (!$isNull(request.replicas)) {
    query['Replicas'] = request.replicas;
  }
  if (!$isNull(request.slice)) {
    query['Slice'] = request.slice;
  }
  if (!$isNull(request.sliceEnvs)) {
    query['SliceEnvs'] = request.sliceEnvs;
  }
  if (!$isNull(request.slsConfigs)) {
    query['SlsConfigs'] = request.slsConfigs;
  }
  if (!$isNull(request.terminationGracePeriodSeconds)) {
    query['TerminationGracePeriodSeconds'] = request.terminationGracePeriodSeconds;
  }
  if (!$isNull(request.timeout)) {
    query['Timeout'] = request.timeout;
  }
  if (!$isNull(request.timezone)) {
    query['Timezone'] = request.timezone;
  }
  if (!$isNull(request.tomcatConfig)) {
    query['TomcatConfig'] = request.tomcatConfig;
  }
  if (!$isNull(request.triggerConfig)) {
    query['TriggerConfig'] = request.triggerConfig;
  }
  if (!$isNull(request.warStartOptions)) {
    query['WarStartOptions'] = request.warStartOptions;
  }
  if (!$isNull(request.webContainer)) {
    query['WebContainer'] = request.webContainer;
  }

  var body : map[string]any = {};
  if (!$isNull(request.acrInstanceId)) {
    body['AcrInstanceId'] = request.acrInstanceId;
  }
  if (!$isNull(request.configMapMountDesc)) {
    body['ConfigMapMountDesc'] = request.configMapMountDesc;
  }
  if (!$isNull(request.enableImageAccl)) {
    body['EnableImageAccl'] = request.enableImageAccl;
  }
  if (!$isNull(request.ossAkId)) {
    body['OssAkId'] = request.ossAkId;
  }
  if (!$isNull(request.ossAkSecret)) {
    body['OssAkSecret'] = request.ossAkSecret;
  }
  if (!$isNull(request.ossMountDescs)) {
    body['OssMountDescs'] = request.ossMountDescs;
  }
  if (!$isNull(request.php)) {
    body['Php'] = request.php;
  }
  if (!$isNull(request.phpConfig)) {
    body['PhpConfig'] = request.phpConfig;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateJob',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/job/updateJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a job template.
 *
 * @param request UpdateJobRequest
 * @return UpdateJobResponse
 */
async function updateJob(request: UpdateJobRequest): UpdateJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateJobWithOptions(request, headers, runtime);
}

model UpdateNamespaceRequest {
  enableMicroRegistration?: boolean(name='EnableMicroRegistration', description='Indicates whether to enable SAE built-in registry:

*   **true**
*   **false**

If you set this parameter to true, a shared registry is created for the namespace. The registry cannot be disabled after it is created.', example='true'),
  nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace. You do not need to specify a region ID. We recommend that you configure this parameter. The value of this parameter can be up to 20 characters in length and can contain only lowercase letters and digits.', example='test'),
  namespaceDescription?: string(name='NamespaceDescription', description='The description of the namespace. The description cannot exceed 100 characters in length.', example='desc'),
  namespaceId?: string(name='NamespaceId', description='The long ID of the namespace. If you configure this parameter, the long ID take effects and the value of the NameSpaceShortId parameter is ignored. To ensure compatibility, we recommend that you specify a short namespace ID. A long namespace ID follows the `<RegionId>:<NamespaceId>` format. The `NamespaceId` variable can contain only lowercase letters and digits. Example: `cn-beijing:test`. The value of the Namespaceid variable cannot exceed 32 characters in length. For more information about **RegionId**, you can call the [DescribeRegions](https://help.aliyun.com/document_detail/2834842.html) operation to obtain the IDs of regions supported by SAE.', example='cn-beijing:test'),
  namespaceName?: string(name='NamespaceName', description='The name of the namespace. The name cannot exceed 64 characters in length.

This parameter is required.', example='name'),
}

model UpdateNamespaceResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **2xx**: The call was successful.
*   **3xx**: The call was redirected.
*   **4xx**: The call failed.
*   **5xx**: A server error occurred.', example='200'),
  data?: {
    enableMicroRegistration?: boolean(name='EnableMicroRegistration', description='Indicates whether to enable SAE built-in registry:

*   **true**
*   **false**', example='true'),
    nameSpaceShortId?: string(name='NameSpaceShortId', description='The short ID of the namespace.', example='test'),
    namespaceDescription?: string(name='NamespaceDescription', description='The description of the namespace.', example='desc'),
    namespaceId?: string(name='NamespaceId', description='The ID of the namespace.', example='cn-beijing:test'),
    namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='name'),
    regionId?: string(name='RegionId', description='The region where the namespace resides.', example='cn-beijing'),
  }(name='Data', description='The information about a namespace.'),
  errorCode?: string(name='ErrorCode', description='The error code returned. Take note of the following rules:

*   The **ErrorCode** parameter is not returned if the request succeeds.
*   If the call fails, the **ErrorCode** parameter is returned. For more information, see the "**Error codes**" section of this topic.', example='Null'),
  message?: string(name='Message', description='The message returned for the operation.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', description='Indicates whether the information about the namespace was updated. Valid values:

*   **true**: The instance was updated.
*   **false**: The instance failed to be updated.', example='true'),
  traceId?: string(name='TraceId', description='The trace ID that is used to query the details of the request.', example='0a98a02315955564772843261e****'),
}

model UpdateNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateNamespaceResponseBody(name='body'),
}

/**
 * @summary Updates the information about a namespace.
 *
 * @param request UpdateNamespaceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateNamespaceResponse
 */
async function updateNamespaceWithOptions(request: UpdateNamespaceRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateNamespaceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.enableMicroRegistration)) {
    query['EnableMicroRegistration'] = request.enableMicroRegistration;
  }
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceDescription)) {
    query['NamespaceDescription'] = request.namespaceDescription;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.namespaceName)) {
    query['NamespaceName'] = request.namespaceName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateNamespace',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/paas/namespace`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the information about a namespace.
 *
 * @param request UpdateNamespaceRequest
 * @return UpdateNamespaceResponse
 */
async function updateNamespace(request: UpdateNamespaceRequest): UpdateNamespaceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateNamespaceWithOptions(request, headers, runtime);
}

model UpdateNamespaceVpcRequest {
  nameSpaceShortId?: string(name='NameSpaceShortId', example='test'),
  namespaceId?: string(name='NamespaceId', description='vpc-2ze0i263cnn311nvj\\\\*\\\\*\\\\*\\\\*', example='cn-beijing:test'),
  vpcId?: string(name='VpcId', description='The ID of the request.

This parameter is required.', example='vpc-2ze0i263cnn311nvj****'),
}

model UpdateNamespaceVpcResponseBody = {
  code?: string(name='Code', description='Indicates whether the VPC information was updated. Valid values:

*   **true**: indicates that the information was updated.
*   **false**: indicates that the information could not be updated.', example='200'),
  errorCode?: string(name='ErrorCode', description='The HTTP status code. Valid values:

*   **2xx**: indicates that the request was successful.
*   **3xx**: indicates that the request was redirected.
*   **4xx**: indicates that the request was invalid.
*   **5xx**: indicates that a server error occurred.'),
  message?: string(name='Message', description='The ID of the trace. It can be used to query the details of a request.', example='success'),
  requestId?: string(name='RequestId', description='The returned message.

*   **success** is returned when the request succeeds.
*   An error code is returned when the request fails.', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', description='The error code.

*   The **ErrorCode** parameter is not returned when the request succeeds.
*   The **ErrorCode** parameter is returned when the request fails. For more information, see **Error codes** in this topic.', example='0a98a02315955564772843261e****'),
}

model UpdateNamespaceVpcResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateNamespaceVpcResponseBody(name='body'),
}

/**
 * @summary cn-beijing:test
 *
 * @param request UpdateNamespaceVpcRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateNamespaceVpcResponse
 */
async function updateNamespaceVpcWithOptions(request: UpdateNamespaceVpcRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateNamespaceVpcResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.nameSpaceShortId)) {
    query['NameSpaceShortId'] = request.nameSpaceShortId;
  }
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateNamespaceVpc',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/namespace/updateNamespaceVpc`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary cn-beijing:test
 *
 * @param request UpdateNamespaceVpcRequest
 * @return UpdateNamespaceVpcResponse
 */
async function updateNamespaceVpc(request: UpdateNamespaceVpcRequest): UpdateNamespaceVpcResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateNamespaceVpcWithOptions(request, headers, runtime);
}

model UpdateSecretRequest {
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace where the Secret resides. If the namespace is the default namespace, you need to only enter the region ID, such as `cn-beijing`.

This parameter is required.', example='cn-beijing:test'),
  secretData?: {
    secretData?: string(name='SecretData', description='The information about the key-value pairs of the Secret. This parameter is required. The following formats are supported:

{"Data":"{"k1":"v1", "k2":"v2"}"}

k specifies a key and v specifies a value. For more information, see [Manage a Kubernetes Secret](https://help.aliyun.com/document_detail/463383.html).

This parameter is required.', example='{".dockerconfigjson":"eyJhdXRocyI6eyJyZWdpc3RyeS12cGMuY24tYmVpamluZy5hbGl5dW5jcy5jb20iOnsidXNlcm5hbWUiOiJ1c2VybmFtZSIsInBhc3N3b3JkIjoicGFzc3dvcmQiLCJhdXRoIjoiZFhObGNtNWhiV1U2Y0dGemMzZHZjbVE9In0sInJlZ2lzdHJ5LmNuLWJlaWppbmcuYWxpeXVuY3MuY29tIjp7InVzZXJuYW1lIjoidXNlcm5hbWUiLCJwYXNzd29yZCI6InBhc3N3b3JkIiwiYXV0aCI6ImRYTmxjbTVoYldVNmNHRnpjM2R2Y21RPSJ9fX0="}'),
  }(name='SecretData', description='The Secret data.

This parameter is required.'),
  secretId?: long(name='SecretId', description='This parameter is required.', example='16'),
}

model UpdateSecretShrinkRequest {
  namespaceId?: string(name='NamespaceId', description='The ID of the namespace where the Secret resides. If the namespace is the default namespace, you need to only enter the region ID, such as `cn-beijing`.

This parameter is required.', example='cn-beijing:test'),
  secretDataShrink?: string(name='SecretData', description='The Secret data.

This parameter is required.'),
  secretId?: long(name='SecretId', description='This parameter is required.', example='16'),
}

model UpdateSecretResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    secretId?: long(name='SecretId', example='16'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success', example='true'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model UpdateSecretResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSecretResponseBody(name='body'),
}

/**
 * @summary The HTTP status code. Valid values:
 * *   **2xx**: The call was successful.
 * *   **3xx**: The call was redirected.
 * *   **4xx**: The call failed.
 * *   **5xx**: A server error occurred.
 *
 * @param tmpReq UpdateSecretRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSecretResponse
 */
async function updateSecretWithOptions(tmpReq: UpdateSecretRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateSecretResponse {
  tmpReq.validate();
  var request = new UpdateSecretShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.secretData)) {
    request.secretDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.secretData, 'SecretData', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }
  if (!$isNull(request.secretDataShrink)) {
    query['SecretData'] = request.secretDataShrink;
  }
  if (!$isNull(request.secretId)) {
    query['SecretId'] = request.secretId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateSecret',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/secret/secret`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The HTTP status code. Valid values:
 * *   **2xx**: The call was successful.
 * *   **3xx**: The call was redirected.
 * *   **4xx**: The call failed.
 * *   **5xx**: A server error occurred.
 *
 * @param request UpdateSecretRequest
 * @return UpdateSecretResponse
 */
async function updateSecret(request: UpdateSecretRequest): UpdateSecretResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSecretWithOptions(request, headers, runtime);
}

model UpdateWebApplicationRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
  body?: UpdateWebApplicationInput(name='body', description='Updates the information about a web application.

This parameter is required.'),
}

model UpdateWebApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationBody  
}

/**
 * @summary Updates the configuration at the web application level.
 *
 * @description You can call the UpdateWebApplication operation to update the configuration at the web application level.
 *
 * @param request UpdateWebApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWebApplicationResponse
 */
async function updateWebApplicationWithOptions(ApplicationId: string, request: UpdateWebApplicationRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateWebApplicationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWebApplication',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/applications/${$URL.percentEncode(ApplicationId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the configuration at the web application level.
 *
 * @description You can call the UpdateWebApplication operation to update the configuration at the web application level.
 *
 * @param request UpdateWebApplicationRequest
 * @return UpdateWebApplicationResponse
 */
async function updateWebApplication(ApplicationId: string, request: UpdateWebApplicationRequest): UpdateWebApplicationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWebApplicationWithOptions(ApplicationId, request, headers, runtime);
}

model UpdateWebApplicationScalingConfigRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
  body?: UpdateWebApplicationScalingConfigInput(name='body', description='The information about scaling configurations.

This parameter is required.'),
}

model UpdateWebApplicationScalingConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationScalingConfigBody  
}

/**
 * @summary Update the scaling configuration of a web application.
 *
 * @description You can call the UpdateWebApplicationScalingConfig operation to update the scaling configurations of a web application.
 *
 * @param request UpdateWebApplicationScalingConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWebApplicationScalingConfigResponse
 */
async function updateWebApplicationScalingConfigWithOptions(ApplicationId: string, request: UpdateWebApplicationScalingConfigRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateWebApplicationScalingConfigResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWebApplicationScalingConfig',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-scaling/${$URL.percentEncode(ApplicationId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the scaling configuration of a web application.
 *
 * @description You can call the UpdateWebApplicationScalingConfig operation to update the scaling configurations of a web application.
 *
 * @param request UpdateWebApplicationScalingConfigRequest
 * @return UpdateWebApplicationScalingConfigResponse
 */
async function updateWebApplicationScalingConfig(ApplicationId: string, request: UpdateWebApplicationScalingConfigRequest): UpdateWebApplicationScalingConfigResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWebApplicationScalingConfigWithOptions(ApplicationId, request, headers, runtime);
}

model UpdateWebApplicationTrafficConfigRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-beijing:test'),
  body?: UpdateWebApplicationTrafficConfigInput(name='body', description='The traffic configurations.

This parameter is required.'),
}

model UpdateWebApplicationTrafficConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebApplicationTrafficConfigBody  
}

/**
 * @summary Update the traffic configurations of a web application.
 *
 * @description Call the UpdateWebApplicationTrafficConfig operation to update the traffic configurations of a web application.
 *
 * @param request UpdateWebApplicationTrafficConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWebApplicationTrafficConfigResponse
 */
async function updateWebApplicationTrafficConfigWithOptions(ApplicationId: string, request: UpdateWebApplicationTrafficConfigRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateWebApplicationTrafficConfigResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWebApplicationTrafficConfig',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/application-traffic/${$URL.percentEncode(ApplicationId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the traffic configurations of a web application.
 *
 * @description Call the UpdateWebApplicationTrafficConfig operation to update the traffic configurations of a web application.
 *
 * @param request UpdateWebApplicationTrafficConfigRequest
 * @return UpdateWebApplicationTrafficConfigResponse
 */
async function updateWebApplicationTrafficConfig(ApplicationId: string, request: UpdateWebApplicationTrafficConfigRequest): UpdateWebApplicationTrafficConfigResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWebApplicationTrafficConfigWithOptions(ApplicationId, request, headers, runtime);
}

model UpdateWebCustomDomainRequest {
  namespaceId?: string(name='NamespaceId', description='The namespace ID.

This parameter is required.', example='cn-hangzhou'),
  body?: UpdateWebCustomDomainInput(name='body', description='The information about the custom domain name.

This parameter is required.'),
}

model UpdateWebCustomDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WebCustomDomainBody  
}

/**
 * @summary Update a custom domain name.
 *
 * @description Update a custom domain name.
 *
 * @param request UpdateWebCustomDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWebCustomDomainResponse
 */
async function updateWebCustomDomainWithOptions(DomainName: string, request: UpdateWebCustomDomainRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateWebCustomDomainResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.namespaceId)) {
    query['NamespaceId'] = request.namespaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateWebCustomDomain',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v2/api/web/custom-domains/${$URL.percentEncode(DomainName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update a custom domain name.
 *
 * @description Update a custom domain name.
 *
 * @param request UpdateWebCustomDomainRequest
 * @return UpdateWebCustomDomainResponse
 */
async function updateWebCustomDomain(DomainName: string, request: UpdateWebCustomDomainRequest): UpdateWebCustomDomainResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateWebCustomDomainWithOptions(DomainName, request, headers, runtime);
}

model UpgradeApplicationApmServiceRequest {
  appId?: string(name='AppId', description='This parameter is required.', example='017f39b8-dfa4-4e16-a84b-1dcee4b1****'),
}

model UpgradeApplicationApmServiceResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    status?: boolean(name='Status', example='true'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='success'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='91F93257-7A4A-4BD3-9A7E-2F6EAE6D****'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId', example='0a98a02315955564772843261e****'),
}

model UpgradeApplicationApmServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeApplicationApmServiceResponseBody(name='body'),
}

/**
 * @summary Enables the advanced monitoring feature of Application Real-Time Monitoring Service (ARMS).
 *
 * @description You are charged when you use the ARMS advanced monitoring feature. Enable this feature based on your business requirements. For more information, see [Billing overview](https://icms.alibaba-inc.com/content/arms/arms?l=1\\&m=16992\\&n=3183148).
 *
 * @param request UpgradeApplicationApmServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeApplicationApmServiceResponse
 */
async function upgradeApplicationApmServiceWithOptions(request: UpgradeApplicationApmServiceRequest, headers: map[string]string, runtime: $RuntimeOptions): UpgradeApplicationApmServiceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.appId)) {
    query['AppId'] = request.appId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpgradeApplicationApmService',
    version = '2019-05-06',
    protocol = 'HTTPS',
    pathname = `/pop/v1/sam/app/applicationApmService`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables the advanced monitoring feature of Application Real-Time Monitoring Service (ARMS).
 *
 * @description You are charged when you use the ARMS advanced monitoring feature. Enable this feature based on your business requirements. For more information, see [Billing overview](https://icms.alibaba-inc.com/content/arms/arms?l=1\\&m=16992\\&n=3183148).
 *
 * @param request UpgradeApplicationApmServiceRequest
 * @return UpgradeApplicationApmServiceResponse
 */
async function upgradeApplicationApmService(request: UpgradeApplicationApmServiceRequest): UpgradeApplicationApmServiceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return upgradeApplicationApmServiceWithOptions(request, headers, runtime);
}

